diff options
Diffstat (limited to 'api-guide/format-suffixes.html')
| -rw-r--r-- | api-guide/format-suffixes.html | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/api-guide/format-suffixes.html b/api-guide/format-suffixes.html index 47ed1a5c..0531f75c 100644 --- a/api-guide/format-suffixes.html +++ b/api-guide/format-suffixes.html @@ -219,12 +219,13 @@ used all the time.</p> </ul> <p>Example:</p> <pre class="prettyprint lang-py"><code>from rest_framework.urlpatterns import format_suffix_patterns +from blog import views -urlpatterns = patterns('blog.views', - url(r'^/$', 'api_root'), - url(r'^comments/$', 'comment_list'), - url(r'^comments/(?P<pk>[0-9]+)/$', 'comment_detail') -) +urlpatterns = [ + url(r'^/$', views.apt_root), + url(r'^comments/$', views.comment_list), + url(r'^comments/(?P<pk>[0-9]+)/$', views.comment_detail) +] urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html']) </code></pre> |
