RequestContext direct_to_template, TEMPLATE_CONTEXT_PROCESSORS

Posted: August 5th, 2010 | Author: Davo | Filed under: Django | Tags: , | No Comments »

If you are wondering why you can’t use {{ request }} in your templates while using
direct_to_template then you probably forgot to edit your TEMPLATE_CONTEXT_PROCESSORS in settings.py

The default TEMPLATE_CONTEXT_PROCESSORS is without the django.core.context_processors.request

TEMPLATE_CONTEXT_PROCESSORS = (
      "django.contrib.auth.context_processors.auth",
      "django.core.context_processors.request",
      "django.core.context_processors.debug",
      "django.core.context_processors.i18n",
      "django.core.context_processors.media",
      "django.contrib.messages.context_processors.messages",
)

Hope this works for you.