Heads up! To view this whole video, sign in with your Courses Plus account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
DIY, or Do It Yourself, custom template tags! Build a template tag that will provide you with a link to the newest course in our library at all times.
Django Documentation: Custom Template Tags and Filters
template
is Django's module for all things template-related. We'll use this several times in the course.
template.Library
is a class that lets us register new tags and filters through an instance of itself.
register.simple_tag(tag_name)
or @register.simple_tag
- Registers a function as a simple tag. Simple tags don't include new templates, don't have an end tag, and don't assign values to context variables.
You need to sign up for Treehouse in order to download course files.
Sign up