August 2016
Beginner to intermediate
717 pages
15h 24m
English
In this recipe, we will create a {% parse %} template tag, which will allow you to put template snippets in the database. This is valuable when you want to provide different content for authenticated and unauthenticated users, when you want to include a personalized salutation or you don't want to hardcode the media paths in the database.
As usual, we will start with the utils app that should be installed and ready for custom template tags.
An advanced custom template tag consists of a function that parses the arguments that are passed to the tag and a Node class that renders the output of the tag or modifies the template context. Perform the following steps to create ...
Read now
Unlock full access