From 3547b3d9581f6937e7d53a11aac9ab793b234872 Mon Sep 17 00:00:00 2001 From: Jose Hidalgo Date: Tue, 21 Apr 2020 00:58:21 -0600 Subject: [PATCH] From Django 1.7.x the name of the option has change. This PR includes the instructions for Django > 1.7.x. --- README.rst | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index f4745ca..b28d29a 100644 --- a/README.rst +++ b/README.rst @@ -24,14 +24,35 @@ Usage ----- 1. Add ``fsm_admin`` to your INSTALLED_APPS -2. Ensure that you have "django.core.context_processors.request" in your TEMPLATE_CONTEXT_PROCESSORS -in Django settings. If TEMPLATE_CONTEXT_PROCESSORS is not yet defined, add +2. For Django <= 1.7.x ensure that you have "django.core.context_processors.request" in your +TEMPLATE_CONTEXT_PROCESSORS in Django settings. If TEMPLATE_CONTEXT_PROCESSORS +is not yet defined, add + +:: + + from django.conf import global_settings + + TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( + 'django.core.context_processors.request', + ) + +For Django > 1.7.x ensure that you have "django.template.context_processors.request" in your +template options: + :: - from django.conf import global_settings - TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( - 'django.core.context_processors.request', - ) + TEMPLATES = [ + { + ... + "OPTIONS": { + ... + "context_processors": [ + ... + "django.template.context_processors.request", + ], + }, + }, + ] 3. In your ``admin.py`` file, use `FSMTransitionMixin` to add behaviour to your ModelAdmin.