aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/urls.py
diff options
context:
space:
mode:
authorTom Christie2014-08-19 13:28:07 +0100
committerTom Christie2014-08-19 13:28:07 +0100
commitbf09c32de8f9d528f83e9cb7a2773d1f4c9ab563 (patch)
tree334c85c136fe1dc010f8d7860b9431b3a9d87e56 /rest_framework/urls.py
parente385a7b8eb6e538698f28128e43fe8bfaefd4e97 (diff)
downloaddjango-rest-framework-bf09c32de8f9d528f83e9cb7a2773d1f4c9ab563.tar.bz2
Code linting and added runtests.py
Diffstat (limited to 'rest_framework/urls.py')
-rw-r--r--rest_framework/urls.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/rest_framework/urls.py b/rest_framework/urls.py
index eed4bd14..8fa3073e 100644
--- a/rest_framework/urls.py
+++ b/rest_framework/urls.py
@@ -8,17 +8,19 @@ your API requires authentication:
...
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 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')
)