From 55a48f812aedb313de0ae53e5c980225a81fba64 Mon Sep 17 00:00:00 2001 From: "Kyle P. Johnson" Date: Sat, 14 Mar 2015 13:28:57 -0400 Subject: [PATCH] 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 ``` --- docs/tutorial/5-relationships-and-hyperlinked-apis.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index 91cdd6f10..68243e75e 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -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: 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([