Closed ghost closed 12 years ago
This is the latest git version 0.4.0_dev
I'm running 0.4.0 because it appeared that 0.3.2 was not compatible with django 1.4...
It sounds like you have the login/logout views included in your urlconf, without the 'djangorestframework' namespace set. Eg in your top level urlconf, you might have a line like this, but without the namespace='djangorestframework' bit?...
url(r'^restframework/', include('djangorestframework.urls', namespace='djangorestframework')),
I didn't know djangorestframework provided login/logout views or any other built-in urls. (until this issue occurred)
I have the following in an app/urls.py file:
( r'^login/$', LoginRESTView.as_view(), ),
( r'^logout/$', LogoutRESTView.as_view(), ),
and in another app/urls.py file: ( r'^login/$', 'django.contrib.auth.views.logout', { 'template_name': 'login.html', 'next_page': '/' }, 'login' ), ( r'^logout/$', 'django.contrib.auth.views.logout', { 'template_name': 'logout.html', 'next_page': '/' }, 'logout' ),
Could either of these be causing the django to inherit the djangorestframework login/logout functions?
This is documented correctly on readthedocs, but the django-rest-framework.org version is out of date (Urg!):
Take a look at http://django-rest-framework.readthedocs.org/en/latest/howto/setup.html#setup
You need to include the restframework views, so that the API browser has a login and logout view that it can use.
On 13 June 2012 16:42, Bill Levering < reply@reply.github.com
wrote:
I didn't know djangorestframework provided login/logout views or any other built-in urls. (until this issue occurred)
I have the following in an app/urls.py file:
( r'^login/$', LoginRESTView.as_view(), ), ( r'^logout/$', LogoutRESTView.as_view(), ),
and in another app/urls.py file: ( r'^login/$', 'django.contrib.auth.views.logout', { 'template_name': 'login.html', 'next_page': '/' }, 'login' ), ( r'^logout/$', 'django.contrib.auth.views.logout', { 'template_name': 'logout.html', 'next_page': '/' }, 'logout' ),
Could either of these be causing the django to inherit the djangorestframework login/logout functions?
Reply to this email directly or view it on GitHub:
https://github.com/tomchristie/django-rest-framework/issues/217#issuecomment-6304620
Yes, I've been reading the out of date site... and this appears to only be an issue in 0.4.
Is the readthedocs site for the dev version and the other for 0.3? Maybe that could be made more clear.
Is the readthedocs site for the dev version and the other for 0.3
Nope, it's just crud and out of date. I'll fix it later this week.
I recently upgraded to django 1.4 as per client request.
I thought everything was working, but it appears not.
Any url request, spits out the error below:
Error during template rendering
In template /usr/lib/python2.6/site-packages/djangorestframework-0.4.0_dev-py2.6.egg/djangorestframework/templates/djangorestframework/base.html, error at line 26