Skip to content

Commit 2e55d15

Browse files
committed
Merge pull request #2703 from kylepjohnson/master
Add necessary imports to final urls.py example
2 parents 53bb483 + d655a42 commit 2e55d15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/tutorial/5-relationships-and-hyperlinked-apis.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ If we're going to have a hyperlinked API, we need to make sure we name our URL p
104104
* Our user serializer includes a field that refers to `'snippet-detail'`.
105105
* Our snippet and user serializers include `'url'` fields that by default will refer to `'{model_name}-detail'`, which in this case will be `'snippet-detail'` and `'user-detail'`.
106106

107-
After adding all those names into our URLconf, our final `snippets/urls.py` file should look something like this:
107+
After adding all those names into our URLconf, our final `snippets/urls.py` file should look like this:
108108

109109
from django.conf.urls import url, include
110+
from rest_framework.urlpatterns import format_suffix_patterns
111+
from snippets import views
110112

111113
# API endpoints
112114
urlpatterns = format_suffix_patterns([

0 commit comments

Comments
 (0)