Django, template context processors

You need to add the default values of TEMPLATE_CONTEXT_PROCESSORS. However, instead of hard-coding those values, which will be tied to a specific version of Django, you can append your context processor to the default values by the following:

from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
    "myapp.processor.foos",
)

Make sure to include the trailing comma in the tuple, so that Python recognizes it as a tuple.

Leave a Comment