From 40c046e99378a49fa3bcaf67311dacdfefb167cc Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Thu, 20 Oct 2016 08:25:37 +0200 Subject: [PATCH 1/3] Adding Django 1.10 to Travis --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1f5b9ac0..b2c3398b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ env: - DJANGO=1.7.11 - DJANGO=1.8.7 - DJANGO=1.9 + - DJANGO=1.10 matrix: exclude: @@ -20,4 +21,4 @@ install: - pip install -q Django==$DJANGO - pip install -q -r requirements.txt -script: python quicktest.py helpdesk \ No newline at end of file +script: python quicktest.py helpdesk From 8e626af41f7bd49d0dd82eed4c45c7545ec3c603 Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Thu, 20 Oct 2016 08:26:06 +0200 Subject: [PATCH 2/3] fixing TEMPLATES on the test settings --- quicktest.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/quicktest.py b/quicktest.py index 381c567b..9c3c23ff 100644 --- a/quicktest.py +++ b/quicktest.py @@ -38,6 +38,27 @@ class QuickDjangoTest(object): 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] + TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': ( + # Defaults: + "django.contrib.auth.context_processors.auth", + "django.template.context_processors.debug", + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.static", + "django.template.context_processors.tz", + "django.contrib.messages.context_processors.messages", + # Our extra: + "django.template.context_processors.request", + ), + }, + }, + ] + def __init__(self, *args, **kwargs): self.apps = args # Get the version of the test suite @@ -91,7 +112,8 @@ class QuickDjangoTest(object): INSTALLED_APPS = self.INSTALLED_APPS + self.apps, MIDDLEWARE_CLASSES = self.MIDDLEWARE_CLASSES, ROOT_URLCONF = self.apps[0] + '.urls', - STATIC_URL = '/static/' + STATIC_URL = '/static/', + TEMPLATES = self.TEMPLATES, ) # compatibility with django 1.8 downwards From c1330bc0c7605a527c4f6f4538c4a127fd931e3e Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Thu, 20 Oct 2016 08:26:31 +0200 Subject: [PATCH 3/3] Updating documentation for Django 1.10 support and settings --- README.rst | 2 +- docs/settings.rst | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 0d770035..5ef3174c 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,7 @@ Dependencies (pre-flight checklist) ----------------------------------- 1. Python 2.7 or 3.4+ (3.4+ support is new, please let us know how it goes) -2. Django (1.7 or newer, preferably 1.9 - Django 1.7 is not supported if you are using Python 3.5) +2. Django (1.7, 1.8, 1.9 and 1.10, preferably 1.9 - Django 1.7 is not supported if you are using Python 3.5) 3. An existing WORKING Django project with database etc. If you cannot log into the Admin, you won't get this product working. 4. `pip install django-bootstrap-form` and add `bootstrapform` to `settings.INSTALLED_APPS` diff --git a/docs/settings.rst b/docs/settings.rst index ed3f716d..9929d540 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -1,7 +1,7 @@ Settings ======== -First, django-helpdesk needs ``django.core.context_processors.request`` activated, so in your ``settings.py`` add:: +First, django-helpdesk needs ``django.core.context_processors.request`` activated, so you must add it to the ``settings.py``. For Django 1.7, add:: from django.conf import global_settings TEMPLATE_CONTEXT_PROCESSORS = ( @@ -9,6 +9,25 @@ First, django-helpdesk needs ``django.core.context_processors.request`` activat ('django.core.context_processors.request',) ) +For Django 1.8 and onwards, the settings are located in the ``TEMPLATES``, and the ``request`` module has moved. Add the following instead:: + + TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + ... + 'OPTIONS': { + ... + 'context_processors': ( + # Default ones first + ... + # The one django-helpdesk requires: + "django.template.context_processors.request", + ), + }, + }, + ] + + The following settings can be changed in your ``settings.py`` file to help change the way django-helpdesk operates. There are quite a few settings available to toggle functionality within django-helpdesk. HELPDESK_DEFAULT_SETTINGS