diff options
| author | Tom Christie | 2014-11-03 11:21:29 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-11-03 11:21:29 +0000 |
| commit | dd14c6c88ba210bac8349041b8db486576539249 (patch) | |
| tree | 81b1e22fb8080a8d3915ae6a5db95edf87a3bfb6 /tutorial/4-authentication-and-permissions.html | |
| parent | ce165805481988e95887bf62c45cd616af5bba0f (diff) | |
| download | django-rest-framework-dd14c6c88ba210bac8349041b8db486576539249.tar.bz2 | |
Latest docs release
Diffstat (limited to 'tutorial/4-authentication-and-permissions.html')
| -rw-r--r-- | tutorial/4-authentication-and-permissions.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tutorial/4-authentication-and-permissions.html b/tutorial/4-authentication-and-permissions.html index ea26e60a..f72c8930 100644 --- a/tutorial/4-authentication-and-permissions.html +++ b/tutorial/4-authentication-and-permissions.html @@ -311,10 +311,10 @@ url(r'^users/(?P<pk>[0-9]+)/$', views.UserDetail.as_view()), <pre class="prettyprint lang-py"><code>from django.conf.urls import include </code></pre> <p>And, at the end of the file, add a pattern to include the login and logout views for the browsable API.</p> -<pre class="prettyprint lang-py"><code>urlpatterns += patterns('', +<pre class="prettyprint lang-py"><code>urlpatterns += [ url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), -) +] </code></pre> <p>The <code>r'^api-auth/'</code> part of pattern can actually be whatever URL you want to use. The only restriction is that the included urls must use the <code>'rest_framework'</code> namespace.</p> <p>Now if you open up the browser again and refresh the page you'll see a 'Login' link in the top right of the page. If you log in as one of the users you created earlier, you'll be able to create code snippets again.</p> |
