aboutsummaryrefslogtreecommitdiffstats
path: root/api-guide/format-suffixes.html
diff options
context:
space:
mode:
Diffstat (limited to 'api-guide/format-suffixes.html')
-rw-r--r--api-guide/format-suffixes.html11
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&lt;pk&gt;[0-9]+)/$', 'comment_detail')
-)
+urlpatterns = [
+ url(r'^/$', views.apt_root),
+ url(r'^comments/$', views.comment_list),
+ url(r'^comments/(?P&lt;pk&gt;[0-9]+)/$', views.comment_detail)
+]
urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html'])
</code></pre>