It’s partly that, but more than just that. It’s also a general “Best-practice” for Django. The DTL is specifically designed with limitations to encourage work be done in Python and not in the templates.
This is a topic that has been discussed a few times here in the past. The most recent thread that I can find is Django design philosophies DTL - confirm if should update
Nope, Django provides facilities for that.
If this is something appearing in multiple views, then you can use a custom context processor to make it available on every page.
This is commonly for things like menus or dynamically generated headers or footers on a page.
It’s also used for other purposes like making specific variables always available, like the currently logged-in user.
Since the context processor receives the request object as a parameter, it can also be customized to provide different values based on the URL or other attributes in the request.
See the docs page starting with The Django template language: for Python programmers | Django documentation | Django for details and examples.
Finally, if you really have unique requirements, you also have the ability to create new tags and filters to cover cases that just can’t be handled any other way.