This commit is contained in:
Danilo Bargen 2013-02-26 11:45:24 -08:00
commit cb1efd8851

View File

@ -28,9 +28,9 @@ Example:
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = patterns('blog.views',
url(r'^/$', 'api_root'),
url(r'^comment/$', 'comment_root'),
url(r'^comment/(?P<pk>[0-9]+)/$', 'comment_instance')
url(r'^$', 'api_root'),
url(r'^comments$', 'comment_root'),
url(r'^comments/(?P<pk>[0-9]+)$', 'comment_instance')
)
urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html'])
@ -58,4 +58,4 @@ It is actually a misconception. For example, take the following quote from Roy
The quote does not mention Accept headers, but it does make it clear that format suffixes should be considered an acceptable pattern.
[cite]: http://tech.groups.yahoo.com/group/rest-discuss/message/5857
[cite2]: http://tech.groups.yahoo.com/group/rest-discuss/message/14844
[cite2]: http://tech.groups.yahoo.com/group/rest-discuss/message/14844