mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
Tweaks
This commit is contained in:
parent
19135061b6
commit
e7ca326555
|
@ -35,9 +35,9 @@ Example:
|
|||
|
||||
urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html'])
|
||||
|
||||
When using `format_suffix_patterns`, you must make sure to add the `'format'` keyword argument to the corresponding view. For example:
|
||||
When using `format_suffix_patterns`, you must make sure to add the `'format'` keyword argument to the corresponding views. For example:
|
||||
|
||||
@api_view(('GET',))
|
||||
@api_view(('GET', 'POST'))
|
||||
def api_root(request, format=None):
|
||||
# do stuff...
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user