From 690ed5794672495e4cffca9a4a701008d254a4e7 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sun, 29 Jul 2012 18:14:26 -0400 Subject: Fixed #18476 - Added use of {% url %} tag to tutorial. Thanks Claude Paroz for the patch. --- docs/intro/tutorial03.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs/intro/tutorial03.txt') diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt index fd3a04ba93..d15b2f43ae 100644 --- a/docs/intro/tutorial03.txt +++ b/docs/intro/tutorial03.txt @@ -533,5 +533,22 @@ under "/content/polls/", or any other path root, and the app will still work. All the poll app cares about is its relative path, not its absolute path. +Removing hardcoded URLs in templates +------------------------------------ + +Remember, when we wrote the link to a poll in our template, the link was +partially hardcoded like this: + +.. code-block:: html+django + +
  • {{ poll.question }}
  • + +To use the decoupled URLs we've just introduced, replace the hardcoded link +with the :ttag:`url` template tag: + +.. code-block:: html+django + +
  • {{ poll.question }}
  • + When you're comfortable with writing views, read :doc:`part 4 of this tutorial ` to learn about simple form processing and generic views. -- cgit v1.3