From 08fe2987af187dc4a4f445da7519177677d044b0 Mon Sep 17 00:00:00 2001 From: Jesse Irwin Date: Mon, 4 Aug 2014 16:49:23 +1000 Subject: [PATCH] Added to post_new to allow 24. Homework: add security to work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If post_new isn’t named, step 24 of the tutorial ends up in an error. --- django_forms/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_forms/README.md b/django_forms/README.md index da24f0acd01..bc956ae555e 100644 --- a/django_forms/README.md +++ b/django_forms/README.md @@ -81,7 +81,7 @@ After saving and refreshing the page `http://127.0.0.1:8000` you will obviously We open `blog/urls.py` and add a line: - url(r'^post/new/$', views.post_new), + url(r'^post/new/$', views.post_new, name='post_new'), And the final code will look like this: @@ -91,7 +91,7 @@ And the final code will look like this: urlpatterns = patterns('', url(r'^$', views.post_list), url(r'^post/(?P[0-9]+)/$', views.post_detail), - url(r'^post/new/$', views.post_new), + url(r'^post/new/$', views.post_new, name='post_new'), ) After refreshing the site, we see an `AttributeError`, since we don't have `post_new` view implemented. Let's add it right now.