This course will be retired on August 28, 2023.
Heads up! To view this whole video, sign in with your Courses 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.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up