How to add a context processor from a Django app
Posted
by Edan Maor
on Stack Overflow
See other posts from Stack Overflow
or by Edan Maor
Published on 2010-05-09T14:12:33Z
Indexed on
2010/05/09
14:18 UTC
Read the original article
Hit count: 291
Say I'm writing a Django app, and all the templates in the app require a certain variable.
The "classic" way to deal with this, afaik, is to write a context processor and add it to TEMPLATE_CONTEXT_PROCESSORS in the settings.py.
My question is, is this the right way to do it, considering that apps are supposed to be "independent" from the actual project using them?
In other words, when deploying that app to a new project, is there any way to avoid the project having to explicitly mess around with its settings?
© Stack Overflow or respective owner