Generally, the content that should be shown on a web page will be defined in the context by views. If the content is to be shown on every page, it is logical to create a context processor to make it available globally. Another situation is when you need to show additional content such as the latest news or a random quote on some pages, for example, the starting page or the details page of an object. In this case, you can load the necessary content with a custom {% load_objects %} template tag, which we will implement in this recipe.
Creating a template tag to load a QuerySet in a template
Getting ready
Once again, we will start with the utils app, which should be installed and ready for custom template tags.
...