summaryrefslogtreecommitdiffstats
path: root/core/context.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-04-05 20:41:34 +0100
committerPhilip Sargent <philip.sargent@gmail.com>2023-04-05 20:41:34 +0100
commit489dd157b6b136941db3ef6b6ea00a67d2149adf (patch)
tree7055119fc2eb3224e35383fdb4eff2563ca87973 /core/context.py
parent0a76acd6649c9964ae3f1c31b93aaa9cfab9db91 (diff)
downloadtroggle-489dd157b6b136941db3ef6b6ea00a67d2149adf.tar.gz
troggle-489dd157b6b136941db3ef6b6ea00a67d2149adf.tar.bz2
troggle-489dd157b6b136941db3ef6b6ea00a67d2149adf.zip
context processor documn link
Diffstat (limited to 'core/context.py')
-rw-r--r--core/context.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/context.py b/core/context.py
index 1f49290..e410fd6 100644
--- a/core/context.py
+++ b/core/context.py
@@ -6,14 +6,17 @@ from troggle.core.models.troggle import Expedition
in the processing of Django templates
This seems to mean that every page produced has bundled in its context the complete 'settings' and
-the expedition class object, so all templates can doe queries on Expedition.
+the expedition class object, so all templates can do queries on Expedition.
https://betterprogramming.pub/django-quick-tips-context-processors-da74f887f1fc
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.
+
+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/
"""
def troggle_context(request):
return {"settings": settings}
- return {"settings": settings, "Expedition": Expedition}
+# return {"settings": settings, "Expedition": Expedition}