aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/urls.py
diff options
context:
space:
mode:
authorJames Rutherford2015-03-11 10:38:03 +0000
committerJames Rutherford2015-03-11 10:38:03 +0000
commit4a2d27975ab5249269aebafd803be87a2107092b (patch)
tree55b524c93b02eef404304f734be98871bbb1324f /rest_framework/urls.py
parent856dc855c952746f566a6a8de263afe951362dfb (diff)
parentdc56e5a0f41fdd6350e91a5749023d086bd1640f (diff)
downloaddjango-rest-framework-4a2d27975ab5249269aebafd803be87a2107092b.tar.bz2
Merge pull request #1 from tomchristie/master
Merge in from upstream
Diffstat (limited to 'rest_framework/urls.py')
-rw-r--r--rest_framework/urls.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/rest_framework/urls.py b/rest_framework/urls.py
index 9c4719f1..cfcee534 100644
--- a/rest_framework/urls.py
+++ b/rest_framework/urls.py
@@ -2,23 +2,25 @@
Login and logout views for the browsable API.
Add these to your root URLconf if you're using the browsable API and
-your API requires authentication.
-
-The urls must be namespaced as 'rest_framework', and you should make sure
-your authentication settings include `SessionAuthentication`.
+your API requires authentication:
urlpatterns = patterns('',
...
- url(r'^auth', include('rest_framework.urls', namespace='rest_framework'))
+ url(r'^auth/', include('rest_framework.urls', namespace='rest_framework'))
)
+
+The urls must be namespaced as 'rest_framework', and you should make sure
+your authentication settings include `SessionAuthentication`.
"""
from __future__ import unicode_literals
-from rest_framework.compat import patterns, url
+from django.conf.urls import patterns, url
+from django.contrib.auth import views
template_name = {'template_name': 'rest_framework/login.html'}
-urlpatterns = patterns('django.contrib.auth.views',
- url(r'^login/$', 'login', template_name, name='login'),
- url(r'^logout/$', 'logout', template_name, name='logout'),
+urlpatterns = patterns(
+ '',
+ url(r'^login/$', views.login, template_name, name='login'),
+ url(r'^logout/$', views.logout, template_name, name='logout')
)