Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django view - apiview decorator (urls.py config)

from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from snippets import views

urlpatterns = [
    path('snippets/', views.snippet_list),
    path('snippets/<int:pk>', views.snippet_detail),
]

urlpatterns = format_suffix_patterns(urlpatterns)
Source by www.django-rest-framework.org #
 
PREVIOUS NEXT
Tagged: #django #view #apiview #decorator
ADD COMMENT
Topic
Name
9+6 =