From 6f0b7bc45537235539e46487fbe6ad9bc933c970 Mon Sep 17 00:00:00 2001 From: Samuel Abels Date: Sun, 25 Nov 2018 09:11:29 +0100 Subject: [PATCH] add docs for installing the context processor --- docs/install.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/install.rst b/docs/install.rst index 16ee61a..a899dc0 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -35,6 +35,34 @@ Add "django_find" to your ``INSTALLED_APPS`` setting like this:: 'django_find', ] +Make sure that the request object is available to templates! +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you haven't already, you should also install Django's +`django.template.context_processors.request `_ +and +`django.template.context_processors.i18n `_. + +In other words, your settings need to set the TEMPLATES +variable to include the context_processors like so:: + + TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + # ... + ], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + # ... + 'django.template.context_processors.i18n', + 'django.template.context_processors.request', + ], + }, + }, + ] + Add it to your models ~~~~~~~~~~~~~~~~~~~~~