mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 13:54:47 +03:00
Add imports to snippets/urls.py example
`snippets/urls.py` requires format_suffix_patterns and views. As-is, the final urls.py example gives the following error: ``` NameError at /snippets name 'format_suffix_patterns' is not defined ``` I have only added two imports from earlier in the tutorial and adjusted the explanatory text. ``` from rest_framework.urlpatterns import format_suffix_patterns from snippets import views ```
This commit is contained in:
parent
57ec1655dc
commit
55a48f812a
|
@ -107,6 +107,9 @@ If we're going to have a hyperlinked API, we need to make sure we name our URL p
|
||||||
After adding all those names into our URLconf, our final `snippets/urls.py` file should look something like this:
|
After adding all those names into our URLconf, our final `snippets/urls.py` file should look something like this:
|
||||||
|
|
||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
|
from rest_framework.urlpatterns import format_suffix_patterns
|
||||||
|
from snippets import views
|
||||||
|
|
||||||
|
|
||||||
# API endpoints
|
# API endpoints
|
||||||
urlpatterns = format_suffix_patterns([
|
urlpatterns = format_suffix_patterns([
|
||||||
|
|
Loading…
Reference in New Issue
Block a user