I'm not sure what I did wrong with my middleware, however I created a
new context processor that set 'myfield', so it's accessible properly
from all templates that are fed a RequestContext. I've kept the
middleware intact to set request.myfield as early as possible in the
request/response cycle,
I have a custom context processor that sets request.myfield, so it can
be used elsewhere such as views, templates, etc. It's a very regularly
accessed piece of information that is required just about everywhere,
so a middleware seemed to be a nifty place to put it.
My TEMPLATE_CONTEXT_PROCESSORS
2 matches
Mail list logo