Skip to content

Commit

Permalink
add docs for installing the context processor
Browse files Browse the repository at this point in the history
  • Loading branch information
knipknap committed Nov 25, 2018
1 parent cd2fa81 commit 6f0b7bc
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.djangoproject.com/en/2.1/ref/templates/api/#django-template-context-processors-request>`_
and
`django.template.context_processors.i18n <https://docs.djangoproject.com/en/2.1/ref/templates/api/#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
~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 6f0b7bc

Please sign in to comment.