- Django 2 by Example
- Antonio Melé
- 88字
- 2021-06-25 21:19:06
Creating custom template tags and filters
Django offers a variety of built-in template tags, such as {% if %} or {% block %}. You have used several in your templates. You can find a complete reference of built-in template tags and filters at https://docs.djangoproject.com/en/2.0/ref/templates/builtins/.
However, Django also allows you to create your own template tags to perform custom actions. Custom template tags come in very handy when you need to add a functionality to your templates that is not covered by the core set of Django template tags.