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/2-requests-and-responses.html | |
| parent | ce165805481988e95887bf62c45cd616af5bba0f (diff) | |
| download | django-rest-framework-dd14c6c88ba210bac8349041b8db486576539249.tar.bz2 | |
Latest docs release
Diffstat (limited to 'tutorial/2-requests-and-responses.html')
| -rw-r--r-- | tutorial/2-requests-and-responses.html | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tutorial/2-requests-and-responses.html b/tutorial/2-requests-and-responses.html index 60acbcf7..8add5464 100644 --- a/tutorial/2-requests-and-responses.html +++ b/tutorial/2-requests-and-responses.html @@ -294,11 +294,12 @@ def snippet_detail(request, pk): <p>Now update the <code>urls.py</code> file slightly, to append a set of <code>format_suffix_patterns</code> in addition to the existing URLs.</p> <pre class="prettyprint lang-py"><code>from django.conf.urls import patterns, url from rest_framework.urlpatterns import format_suffix_patterns +from snippets import views -urlpatterns = patterns('snippets.views', - url(r'^snippets/$', 'snippet_list'), - url(r'^snippets/(?P<pk>[0-9]+)$', 'snippet_detail'), -) +urlpatterns = [ + url(r'^snippets/$', views.snippet_list), + url(r'^snippets/(?P<pk>[0-9]+)$', views.snippet_detail), +] urlpatterns = format_suffix_patterns(urlpatterns) </code></pre> |
