diff options
| author | Tom Christie | 2015-03-16 15:33:00 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-03-16 15:33:00 +0000 |
| commit | 2e55d15d4daa38c6dcb6fb43ab41b9a18ce5ca75 (patch) | |
| tree | 32d4b437d1178eb78aa93b623fb520bf48e78f4d /docs/tutorial | |
| parent | 53bb4832d310cbc5dd48b5cd455e306490917a64 (diff) | |
| parent | d655a423fb06ec8b5880a1fb63ed6ad885753a94 (diff) | |
| download | django-rest-framework-2e55d15d4daa38c6dcb6fb43ab41b9a18ce5ca75.tar.bz2 | |
Merge pull request #2703 from kylepjohnson/master
Add necessary imports to final urls.py example
Diffstat (limited to 'docs/tutorial')
| -rw-r--r-- | docs/tutorial/5-relationships-and-hyperlinked-apis.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index 91cdd6f1..46ba4ad8 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -104,9 +104,11 @@ If we're going to have a hyperlinked API, we need to make sure we name our URL p * Our user serializer includes a field that refers to `'snippet-detail'`. * 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'`. -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 like this: from django.conf.urls import url, include + from rest_framework.urlpatterns import format_suffix_patterns + from snippets import views # API endpoints urlpatterns = format_suffix_patterns([ |
