2009-05-13 05:52:15 +01:00
|
|
|
from django.conf import settings
|
2023-01-19 18:35:56 +00:00
|
|
|
|
2021-04-13 00:43:57 +01:00
|
|
|
from troggle.core.models.troggle import Expedition
|
2009-05-13 05:52:15 +01:00
|
|
|
|
2023-01-30 19:04:36 +00:00
|
|
|
"""This is the only troggle-specific 'context processor' that troggle uses
|
2021-04-13 01:37:42 +01:00
|
|
|
in the processing of Django templates
|
|
|
|
|
|
|
|
This seems to mean that every page produced has bundled in its context the complete 'settings' and
|
2023-04-05 20:41:34 +01:00
|
|
|
the expedition class object, so all templates can do queries on Expedition.
|
2021-04-13 01:37:42 +01:00
|
|
|
https://betterprogramming.pub/django-quick-tips-context-processors-da74f887f1fc
|
2021-04-13 02:29:24 +01:00
|
|
|
|
|
|
|
If it is commented out, the logbookentry page goes crazy and the screws up all the site_media resultions for CSS file s!
|
|
|
|
Seems to be necessary to make {{settings.MEDIA_URL}} work. Which is obvious in retrospect.
|
2023-04-05 20:41:34 +01:00
|
|
|
|
|
|
|
It is VITAL that no database operations are done in any context processor, see
|
|
|
|
https://adamj.eu/tech/2023/03/23/django-context-processors-database-queries/
|
2023-01-30 19:04:36 +00:00
|
|
|
"""
|
|
|
|
|
2021-04-13 01:37:42 +01:00
|
|
|
|
2009-05-19 06:32:42 +01:00
|
|
|
def troggle_context(request):
|
2023-01-30 19:04:36 +00:00
|
|
|
return {"settings": settings}
|
2023-04-05 20:41:34 +01:00
|
|
|
# return {"settings": settings, "Expedition": Expedition}
|