workspace
stringclasses 1
value | channel
stringclasses 1
value | sentences
stringlengths 1
3.93k
| ts
stringlengths 26
26
| user
stringlengths 2
11
| sentence_id
stringlengths 44
53
| timestamp
float64 1.5B
1.56B
| __index_level_0__
int64 0
106k
|
---|---|---|---|---|---|---|---|
pythondev | help | How can they be used | 2019-03-31T21:45:13.465200 | Harvey | pythondev_help_Harvey_2019-03-31T21:45:13.465200 | 1,554,068,713.4652 | 16,121 |
pythondev | help | in python | 2019-03-31T21:47:04.465500 | Rodrick | pythondev_help_Rodrick_2019-03-31T21:47:04.465500 | 1,554,068,824.4655 | 16,122 |
pythondev | help | nvm | 2019-03-31T21:47:15.465700 | Rodrick | pythondev_help_Rodrick_2019-03-31T21:47:15.465700 | 1,554,068,835.4657 | 16,123 |
pythondev | help | <@Harvey> <https://rszalski.github.io/magicmethods/> | 2019-03-31T21:47:21.465900 | Rodrick | pythondev_help_Rodrick_2019-03-31T21:47:21.465900 | 1,554,068,841.4659 | 16,124 |
pythondev | help | are you referring to django form? If that's the case, i am using django only for api. | 2019-03-31T22:06:13.466100 | Elenore | pythondev_help_Elenore_2019-03-31T22:06:13.466100 | 1,554,069,973.4661 | 16,125 |
pythondev | help | Hello guys. | 2019-04-01T05:01:50.467100 | Jannie | pythondev_help_Jannie_2019-04-01T05:01:50.467100 | 1,554,094,910.4671 | 16,126 |
pythondev | help | I am new to Djangorestframework. Right now I am doing activate virtualenv on windows 10. How can I do it? | 2019-04-01T05:02:18.467900 | Jannie | pythondev_help_Jannie_2019-04-01T05:02:18.467900 | 1,554,094,938.4679 | 16,127 |
pythondev | help | I am working on git bash. | 2019-04-01T05:03:04.468400 | Jannie | pythondev_help_Jannie_2019-04-01T05:03:04.468400 | 1,554,094,984.4684 | 16,128 |
pythondev | help | <@Jannie> you could try <https://github.com/regisf/virtualenvwrapper-powershell> | 2019-04-01T05:04:01.468700 | Shawana | pythondev_help_Shawana_2019-04-01T05:04:01.468700 | 1,554,095,041.4687 | 16,129 |
pythondev | help | I will try | 2019-04-01T05:04:50.469000 | Jannie | pythondev_help_Jannie_2019-04-01T05:04:50.469000 | 1,554,095,090.469 | 16,130 |
pythondev | help | Does virtualenvwrapper exist only on windows? | 2019-04-01T05:21:05.469900 | Jannie | pythondev_help_Jannie_2019-04-01T05:21:05.469900 | 1,554,096,065.4699 | 16,131 |
pythondev | help | no | 2019-04-01T05:21:23.470100 | Shawana | pythondev_help_Shawana_2019-04-01T05:21:23.470100 | 1,554,096,083.4701 | 16,132 |
pythondev | help | I think the command of activating virtualenv is "workon" | 2019-04-01T05:21:55.470600 | Jannie | pythondev_help_Jannie_2019-04-01T05:21:55.470600 | 1,554,096,115.4706 | 16,133 |
pythondev | help | But it is relevant with virtualenvwrapper. Is it right? | 2019-04-01T05:22:14.471100 | Jannie | pythondev_help_Jannie_2019-04-01T05:22:14.471100 | 1,554,096,134.4711 | 16,134 |
pythondev | help | what do you mean with "is relevant"? | 2019-04-01T05:22:46.471400 | Shawana | pythondev_help_Shawana_2019-04-01T05:22:46.471400 | 1,554,096,166.4714 | 16,135 |
pythondev | help | Activating command of virtualenv is "workon", I think. "workon" is available only on windows? | 2019-04-01T05:25:13.473100 | Jannie | pythondev_help_Jannie_2019-04-01T05:25:13.473100 | 1,554,096,313.4731 | 16,136 |
pythondev | help | no, if you are using virtualenvwrapper the command `workon` is available | 2019-04-01T05:26:34.474100 | Shawana | pythondev_help_Shawana_2019-04-01T05:26:34.474100 | 1,554,096,394.4741 | 16,137 |
pythondev | help | virtualenvwrapper is an extension to virtualenv (see the docs@ <https://virtualenvwrapper.readthedocs.io/en/latest/>) | 2019-04-01T05:28:12.474900 | Shawana | pythondev_help_Shawana_2019-04-01T05:28:12.474900 | 1,554,096,492.4749 | 16,138 |
pythondev | help | I see. | 2019-04-01T05:29:30.475100 | Jannie | pythondev_help_Jannie_2019-04-01T05:29:30.475100 | 1,554,096,570.4751 | 16,139 |
pythondev | help | If you are on windows, I recommend using the wrapper with powershell linked above, because you want to use powershell anyways - and to manage your virtualenvs with this module works seamless | 2019-04-01T05:31:10.476300 | Shawana | pythondev_help_Shawana_2019-04-01T05:31:10.476300 | 1,554,096,670.4763 | 16,140 |
pythondev | help | OK. Thank you | 2019-04-01T05:31:29.476500 | Jannie | pythondev_help_Jannie_2019-04-01T05:31:29.476500 | 1,554,096,689.4765 | 16,141 |
pythondev | help | I have installed djangorestframework and types "python manage.py runserver" on venv. But there is error. | 2019-04-01T05:37:55.478600 | Jannie | pythondev_help_Jannie_2019-04-01T05:37:55.478600 | 1,554,097,075.4786 | 16,142 |
pythondev | help | what error? | 2019-04-01T05:38:19.478800 | Shawana | pythondev_help_Shawana_2019-04-01T05:38:19.478800 | 1,554,097,099.4788 | 16,143 |
pythondev | help | None | 2019-04-01T05:38:27.479100 | Jannie | pythondev_help_Jannie_2019-04-01T05:38:27.479100 | 1,554,097,107.4791 | 16,144 |
pythondev | help | so you have to install django inside your virtual env :wink: | 2019-04-01T05:38:58.480500 | Shawana | pythondev_help_Shawana_2019-04-01T05:38:58.480500 | 1,554,097,138.4805 | 16,145 |
pythondev | help | please I'm trying to do ```sudo ./setup.py build``` when cmake available it's version is .10. it works and gives an error ``` CMake 3.11.0 or higher is required. You are running version 3.10.2 ``` so I removed the existed version and follow the instructions here <https://cgold.readthedocs.io/en/latest/first-step/installation.html> with downloading the latest version... and when I do ``` cmake --version
cmake version 3.14.0
CMake suite maintained and supported by Kitware (<http://kitware.com/cmake|kitware.com/cmake>).
``` I now tried to make ```sudo ./setup.py build``` it gives ``` running build
error: [Errno 2] No such file or directory
``` | 2019-04-01T05:39:34.481000 | Tanja | pythondev_help_Tanja_2019-04-01T05:39:34.481000 | 1,554,097,174.481 | 16,146 |
pythondev | help | None | 2019-04-01T05:40:18.481200 | Jannie | pythondev_help_Jannie_2019-04-01T05:40:18.481200 | 1,554,097,218.4812 | 16,147 |
pythondev | help | I have installed djangorestframework before. | 2019-04-01T05:40:31.481900 | Jannie | pythondev_help_Jannie_2019-04-01T05:40:31.481900 | 1,554,097,231.4819 | 16,148 |
pythondev | help | Have you installed Django tho? | 2019-04-01T05:45:34.482100 | Jonas | pythondev_help_Jonas_2019-04-01T05:45:34.482100 | 1,554,097,534.4821 | 16,149 |
pythondev | help | I didn't installed Django. Just installed djangorestframework | 2019-04-01T06:21:39.482600 | Jannie | pythondev_help_Jannie_2019-04-01T06:21:39.482600 | 1,554,099,699.4826 | 16,150 |
pythondev | help | run `pip freeze` and see if Django is there, pretty sure it installs Django? :thinking_face: | 2019-04-01T06:23:23.483300 | Mica | pythondev_help_Mica_2019-04-01T06:23:23.483300 | 1,554,099,803.4833 | 16,151 |
pythondev | help | Do you mean I have to install djangorestframework and django both? | 2019-04-01T06:28:00.483800 | Jannie | pythondev_help_Jannie_2019-04-01T06:28:00.483800 | 1,554,100,080.4838 | 16,152 |
pythondev | help | Yes, take a look at their example: | 2019-04-01T06:31:12.484100 | Melynda | pythondev_help_Melynda_2019-04-01T06:31:12.484100 | 1,554,100,272.4841 | 16,153 |
pythondev | help | <https://github.com/encode/django-rest-framework#example> | 2019-04-01T06:31:13.484300 | Melynda | pythondev_help_Melynda_2019-04-01T06:31:13.484300 | 1,554,100,273.4843 | 16,154 |
pythondev | help | Ok | 2019-04-01T06:39:10.484800 | Jannie | pythondev_help_Jannie_2019-04-01T06:39:10.484800 | 1,554,100,750.4848 | 16,155 |
pythondev | help | good morning | 2019-04-01T07:37:00.485100 | Florencio | pythondev_help_Florencio_2019-04-01T07:37:00.485100 | 1,554,104,220.4851 | 16,156 |
pythondev | help | how do I include `static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)` | 2019-04-01T07:37:17.485500 | Florencio | pythondev_help_Florencio_2019-04-01T07:37:17.485500 | 1,554,104,237.4855 | 16,157 |
pythondev | help | I already have this:
```
urlpatterns = [
path('admin/', admin.site.urls),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
``` | 2019-04-01T07:37:52.486000 | Florencio | pythondev_help_Florencio_2019-04-01T07:37:52.486000 | 1,554,104,272.486 | 16,158 |
pythondev | help | in settings, I have:
```
STATIC_URL = '/static/'
MEDIAL_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
``` | 2019-04-01T07:38:33.486600 | Florencio | pythondev_help_Florencio_2019-04-01T07:38:33.486600 | 1,554,104,313.4866 | 16,159 |
pythondev | help | Where do you want to include it? And what do you mean by include? | 2019-04-01T07:39:10.487100 | Valeri | pythondev_help_Valeri_2019-04-01T07:39:10.487100 | 1,554,104,350.4871 | 16,160 |
pythondev | help | <@Florencio> | 2019-04-01T07:40:19.487400 | Valeri | pythondev_help_Valeri_2019-04-01T07:40:19.487400 | 1,554,104,419.4874 | 16,161 |
pythondev | help | add it to the `urlpatterns` | 2019-04-01T07:40:54.487800 | Florencio | pythondev_help_Florencio_2019-04-01T07:40:54.487800 | 1,554,104,454.4878 | 16,162 |
pythondev | help | so do it? | 2019-04-01T07:41:04.488000 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:41:04.488000 | 1,554,104,464.488 | 16,163 |
pythondev | help | :slightly_smiling_face: | 2019-04-01T07:41:10.488500 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:41:10.488500 | 1,554,104,470.4885 | 16,164 |
pythondev | help | but be aware the above is just for development | 2019-04-01T07:41:37.489200 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:41:37.489200 | 1,554,104,497.4892 | 16,165 |
pythondev | help | yeah did `urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)` | 2019-04-01T07:41:38.489400 | Florencio | pythondev_help_Florencio_2019-04-01T07:41:38.489400 | 1,554,104,498.4894 | 16,166 |
pythondev | help | does not apply to deployment | 2019-04-01T07:41:41.489500 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:41:41.489500 | 1,554,104,501.4895 | 16,167 |
pythondev | help | wait what? | 2019-04-01T07:41:51.489700 | Florencio | pythondev_help_Florencio_2019-04-01T07:41:51.489700 | 1,554,104,511.4897 | 16,168 |
pythondev | help | wait a minute | 2019-04-01T07:42:00.490000 | Florencio | pythondev_help_Florencio_2019-04-01T07:42:00.490000 | 1,554,104,520.49 | 16,169 |
pythondev | help | Yes that's a bad idea for prod | 2019-04-01T07:42:14.490700 | Valeri | pythondev_help_Valeri_2019-04-01T07:42:14.490700 | 1,554,104,534.4907 | 16,170 |
pythondev | help | so how do i display the image uploaded? | 2019-04-01T07:42:37.491200 | Florencio | pythondev_help_Florencio_2019-04-01T07:42:37.491200 | 1,554,104,557.4912 | 16,171 |
pythondev | help | an image uploaded goes to the `/media/` | 2019-04-01T07:42:54.491600 | Florencio | pythondev_help_Florencio_2019-04-01T07:42:54.491600 | 1,554,104,574.4916 | 16,172 |
pythondev | help | so what am i supposed to do? | 2019-04-01T07:43:04.491900 | Florencio | pythondev_help_Florencio_2019-04-01T07:43:04.491900 | 1,554,104,584.4919 | 16,173 |
pythondev | help | what the above does is let you use runserver, or the development django test server program, to easily let you work locally | 2019-04-01T07:43:42.492600 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:43:42.492600 | 1,554,104,622.4926 | 16,174 |
pythondev | help | but using runserver in prod is a very bad idea, unless you really desire bad performance and wide open security doors | 2019-04-01T07:44:15.493400 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:44:15.493400 | 1,554,104,655.4934 | 16,175 |
pythondev | help | so static and media files are best handled by either apache or nginx, which will route the requests to your media/static folders you define in that config, as well as pass your django requests to either gunicorn, mod_wsgi or uwsgi (depending on what you select) | 2019-04-01T07:45:40.495000 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:45:40.495000 | 1,554,104,740.495 | 16,176 |
pythondev | help | is that pronounced `En-gine-X`? | 2019-04-01T07:46:25.495500 | Florencio | pythondev_help_Florencio_2019-04-01T07:46:25.495500 | 1,554,104,785.4955 | 16,177 |
pythondev | help | <https://simpleisbetterthancomplex.com/series/2017/09/11/a-complete-beginners-guide-to-django-part-2.html#views-templates-and-static-files> | 2019-04-01T07:47:16.495700 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:47:16.495700 | 1,554,104,836.4957 | 16,178 |
pythondev | help | yes | 2019-04-01T07:47:58.496300 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:47:58.496300 | 1,554,104,878.4963 | 16,179 |
pythondev | help | lots of the examples only talk about one of the staticfiles which is `static` | 2019-04-01T07:52:51.497000 | Florencio | pythondev_help_Florencio_2019-04-01T07:52:51.497000 | 1,554,105,171.497 | 16,180 |
pythondev | help | so whatabout `media`? | 2019-04-01T07:53:06.497400 | Florencio | pythondev_help_Florencio_2019-04-01T07:53:06.497400 | 1,554,105,186.4974 | 16,181 |
pythondev | help | like how do I take care of images uploaded by the user/admin? | 2019-04-01T07:53:38.498000 | Florencio | pythondev_help_Florencio_2019-04-01T07:53:38.498000 | 1,554,105,218.498 | 16,182 |
pythondev | help | I tried adding it, had errors in `runserver` | 2019-04-01T07:54:02.498500 | Florencio | pythondev_help_Florencio_2019-04-01T07:54:02.498500 | 1,554,105,242.4985 | 16,183 |
pythondev | help | <https://django.readthedocs.io/en/2.1.x/howto/static-files/#serving-files-uploaded-by-a-user-during-development> | 2019-04-01T07:55:57.498900 | Hiroko | pythondev_help_Hiroko_2019-04-01T07:55:57.498900 | 1,554,105,357.4989 | 16,184 |
pythondev | help | sorry I saw that | 2019-04-01T07:59:05.499100 | Florencio | pythondev_help_Florencio_2019-04-01T07:59:05.499100 | 1,554,105,545.4991 | 16,185 |
pythondev | help | but my confusion is I also have static, so how do i add media? | 2019-04-01T07:59:28.499600 | Florencio | pythondev_help_Florencio_2019-04-01T07:59:28.499600 | 1,554,105,568.4996 | 16,186 |
pythondev | help | again, same way | 2019-04-01T08:00:38.499900 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:00:38.499900 | 1,554,105,638.4999 | 16,187 |
pythondev | help | ```urlpatterns = [
path('admin/', admin.site.urls),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
+ static(MEDIA STUFF)``` | 2019-04-01T08:01:10.500700 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:01:10.500700 | 1,554,105,670.5007 | 16,188 |
pythondev | help | that looks weird | 2019-04-01T08:01:53.501500 | Florencio | pythondev_help_Florencio_2019-04-01T08:01:53.501500 | 1,554,105,713.5015 | 16,189 |
pythondev | help | I’ve not done this in a while, to be honest | 2019-04-01T08:02:14.502000 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:02:14.502000 | 1,554,105,734.502 | 16,190 |
pythondev | help | because I mainly use docker | 2019-04-01T08:02:19.502300 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:02:19.502300 | 1,554,105,739.5023 | 16,191 |
pythondev | help | and everything’s containerized to replicate most of what prod has | 2019-04-01T08:02:34.503000 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:02:34.503000 | 1,554,105,754.503 | 16,192 |
pythondev | help | Hello there!
I have a rather simple (view) decorator which looks something like below:
```
def access_logger(view_function):
@wraps(view_function)
def wrap(request, *args, **kwargs):
print(request)
app = request.auth.application
user = request.user
access = AppUserAccess.objects.create(
app=app,
user=user
)
return view_function(request, *args, **kwargs)
return wrap
```
And is implemented like:
```
@access_logger
class ArticleViewSet(ViewSetMixin):
permission_classes = [permissions.IsAuthenticated, TokenIsWebservice, UserHasApp]
serializer_class = ArticleSerializer
model = Article
pk_field = 'id'
```
When applying the <@Marvella>_logger decorator my call returns a 404. I have a feeling that I am making a mistake in my decorator, but not totally sure how and/or what
Console doesn't return any errors as well | 2019-04-01T08:02:54.503500 | Eliz | pythondev_help_Eliz_2019-04-01T08:02:54.503500 | 1,554,105,774.5035 | 16,193 |
pythondev | help | do you have logging? | 2019-04-01T08:04:23.504100 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:04:23.504100 | 1,554,105,863.5041 | 16,194 |
pythondev | help | `print` won’t work in a number of situations with django | 2019-04-01T08:04:40.504600 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:04:40.504600 | 1,554,105,880.5046 | 16,195 |
pythondev | help | so you really should use logging instead | 2019-04-01T08:04:46.504900 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:04:46.504900 | 1,554,105,886.5049 | 16,196 |
pythondev | help | also
```access = AppUserAccess.objects.create(
app=app,
user=user
)``` | 2019-04-01T08:05:02.505100 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:05:02.505100 | 1,554,105,902.5051 | 16,197 |
pythondev | help | I really hope `app` and `user` are a composite unique pair, because otherwise you’re going to be having a _very_ big database table | 2019-04-01T08:05:35.505900 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:05:35.505900 | 1,554,105,935.5059 | 16,198 |
pythondev | help | I would use `get_or_create` instead | 2019-04-01T08:06:02.506400 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:06:02.506400 | 1,554,105,962.5064 | 16,199 |
pythondev | help | Yea we're not speaking of actual production content right now -- simply having the issue of getting 404s when adding (a) decorator | 2019-04-01T08:06:20.507100 | Eliz | pythondev_help_Eliz_2019-04-01T08:06:20.507100 | 1,554,105,980.5071 | 16,200 |
pythondev | help | Thanks for the notice though | 2019-04-01T08:06:35.507400 | Eliz | pythondev_help_Eliz_2019-04-01T08:06:35.507400 | 1,554,105,995.5074 | 16,201 |
pythondev | help | 404 means resource not found | 2019-04-01T08:06:40.507700 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:06:40.507700 | 1,554,106,000.5077 | 16,202 |
pythondev | help | does it work without the decorator? | 2019-04-01T08:06:49.508300 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:06:49.508300 | 1,554,106,009.5083 | 16,203 |
pythondev | help | Yea | 2019-04-01T08:06:57.508800 | Eliz | pythondev_help_Eliz_2019-04-01T08:06:57.508800 | 1,554,106,017.5088 | 16,204 |
pythondev | help | I have the feeling that it silently drops the route when there's an error or something | 2019-04-01T08:07:16.509300 | Eliz | pythondev_help_Eliz_2019-04-01T08:07:16.509300 | 1,554,106,036.5093 | 16,205 |
pythondev | help | <https://github.com/django/django/blob/master/django/contrib/auth/decorators.py#L10-L35> | 2019-04-01T08:08:55.509500 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:08:55.509500 | 1,554,106,135.5095 | 16,206 |
pythondev | help | as you can see there, there’s something missing from your own decorator | 2019-04-01T08:09:06.509900 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:09:06.509900 | 1,554,106,146.5099 | 16,207 |
pythondev | help | not sure if that’s relevant, though | 2019-04-01T08:09:24.510200 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:09:24.510200 | 1,554,106,164.5102 | 16,208 |
pythondev | help | or <https://github.com/django/django/blob/master/django/views/decorators/http.py#L18-L42> | 2019-04-01T08:10:15.510400 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:10:15.510400 | 1,554,106,215.5104 | 16,209 |
pythondev | help | ```def require_http_methods(request_method_list):
"""
Decorator to make a view only accept particular request methods. Usage::
@require_http_methods(["GET", "POST"])
def my_view(request):
# I can assume now that only GET or POST requests make it this far
# ...
Note that request methods should be in uppercase.
"""
def decorator(func):
@wraps(func)
def inner(request, *args, **kwargs):
if request.method not in request_method_list:
response = HttpResponseNotAllowed(request_method_list)
log_response(
'Method Not Allowed (%s): %s', request.method, request.path,
response=response,
request=request,
)
return response
return func(request, *args, **kwargs)
return inner
return decorator``` | 2019-04-01T08:10:26.510700 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:10:26.510700 | 1,554,106,226.5107 | 16,210 |
pythondev | help | same with `cache_control` | 2019-04-01T08:10:55.511000 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:10:55.511000 | 1,554,106,255.511 | 16,211 |
pythondev | help | ```def cache_control(**kwargs):
def _cache_controller(viewfunc):
@wraps(viewfunc)
def _cache_controlled(request, *args, **kw):
response = viewfunc(request, *args, **kw)
patch_cache_control(response, **kwargs)
return response
return _cache_controlled
return _cache_controller``` | 2019-04-01T08:10:57.511200 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:10:57.511200 | 1,554,106,257.5112 | 16,212 |
pythondev | help | you basically have everything inside the decorator, but there’s three levels | 2019-04-01T08:11:13.511600 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:11:13.511600 | 1,554,106,273.5116 | 16,213 |
pythondev | help | ```
def outer
def _inner(viewfunc)
@wraps(viewfunc)
def _decorator_processor
# code
return something
return _decorator_processor
return _inner
``` | 2019-04-01T08:12:25.513100 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:12:25.513100 | 1,554,106,345.5131 | 16,214 |
pythondev | help | ```
raise ImproperlyConfigured("Empty static prefix not permitted")
django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
```
this is the exception raised | 2019-04-01T08:12:37.513200 | Florencio | pythondev_help_Florencio_2019-04-01T08:12:37.513200 | 1,554,106,357.5132 | 16,215 |
pythondev | help | hmm | 2019-04-01T08:12:53.513400 | Eliz | pythondev_help_Eliz_2019-04-01T08:12:53.513400 | 1,554,106,373.5134 | 16,216 |
pythondev | help | ```
def access_logger():
def decorator(f):
@wraps(f)
def wrap(request, *args, **kwargs):
print('test.')
return f(request, *args, **kwargs)
return wrap
return decorator
```
```
@access_logger()
class ArticleViewSet(BaseWMSViewSetMixin):
permission_classes = [permissions.IsAuthenticated, TokenIsWebservice, UserHasApp]
serializer_class = ArticleSerializer
model = Article
pk_field = 'id'
```
Results into the same 404 | 2019-04-01T08:16:39.513800 | Eliz | pythondev_help_Eliz_2019-04-01T08:16:39.513800 | 1,554,106,599.5138 | 16,217 |
pythondev | help | Hmm. Wonder if something is happening due to the viewset | 2019-04-01T08:17:53.515100 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:17:53.515100 | 1,554,106,673.5151 | 16,218 |
pythondev | help | using `@access_logger` instead of `access_logger()` results in an `TypeError: access_logger() takes 0 positional arguments but 1 was given` error though | 2019-04-01T08:17:54.515200 | Eliz | pythondev_help_Eliz_2019-04-01T08:17:54.515200 | 1,554,106,674.5152 | 16,219 |
pythondev | help | I think you need to have at least `**kwargs` in the outer | 2019-04-01T08:19:32.516500 | Hiroko | pythondev_help_Hiroko_2019-04-01T08:19:32.516500 | 1,554,106,772.5165 | 16,220 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.