summaryrefslogtreecommitdiff
path: root/patchwork/settings
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2018-04-07 17:57:33 +0100
committerStephen Finucane <stephen@that.guru>2018-04-09 17:36:49 +0100
commit493f599a2b7cb39d8d67a5f75a32c5cd3fed15c4 (patch)
treecf38f1cbe71bb748c14146adc9abddaef9b25ca4 /patchwork/settings
parentc8bbe3a7e15c96029e89a02ddd49472e3d2af3a5 (diff)
downloadpatchwork-493f599a2b7cb39d8d67a5f75a32c5cd3fed15c4.tar
patchwork-493f599a2b7cb39d8d67a5f75a32c5cd3fed15c4.tar.gz
trivial: Remove additional Django < 1.8 code
Yet more stuff that was missed in the previous changes. Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'patchwork/settings')
-rw-r--r--patchwork/settings/dev.py56
-rw-r--r--patchwork/settings/production.example.py7
2 files changed, 25 insertions, 38 deletions
diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index 26d3e83..1f686f4 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -25,11 +25,6 @@ SECRET_KEY = '00000000000000000000000000000000000000000000000000' # noqa
DEBUG = True
-if django.VERSION < (1, 8):
- # In Django 1.8+, this is only necessary if the value differs from
- # the value for 'DEBUG'
- TEMPLATE_DEBUG = True
-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
@@ -38,19 +33,15 @@ DATABASES = {
'USER': os.getenv('PW_TEST_DB_USER', 'patchwork'),
'PASSWORD': os.getenv('PW_TEST_DB_PASS', 'password'),
'NAME': os.getenv('PW_TEST_DB_NAME', 'patchwork'),
+ 'TEST': {
+ 'CHARSET': 'utf8',
+ },
},
}
if os.getenv('PW_TEST_DB_TYPE', None) == 'postgres':
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
-if django.VERSION >= (1, 7):
- DATABASES['default']['TEST'] = {
- 'CHARSET': 'utf8',
- }
-else:
- DATABASES['default']['TEST_CHARSET'] = 'utf8'
-
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
#
@@ -68,27 +59,26 @@ PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher']
# django-debug-toolbar
-if django.VERSION >= (1, 8):
- INSTALLED_APPS += [
- 'debug_toolbar'
- ]
-
- DEBUG_TOOLBAR_PATCH_SETTINGS = False
-
- # This should go first in the middleware classes
- if django.VERSION >= (1, 10):
- MIDDLEWARE = [
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
- ] + MIDDLEWARE
- else:
- MIDDLEWARE_CLASSES = [
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
- ] + MIDDLEWARE_CLASSES
-
- INTERNAL_IPS = [
- '127.0.0.1', '::1',
- '172.17.0.1'
- ]
+INSTALLED_APPS += [
+ 'debug_toolbar'
+]
+
+DEBUG_TOOLBAR_PATCH_SETTINGS = False
+
+# This should go first in the middleware classes
+if django.VERSION >= (1, 10):
+ MIDDLEWARE = [
+ 'debug_toolbar.middleware.DebugToolbarMiddleware',
+ ] + MIDDLEWARE
+else:
+ MIDDLEWARE_CLASSES = [
+ 'debug_toolbar.middleware.DebugToolbarMiddleware',
+ ] + MIDDLEWARE_CLASSES
+
+INTERNAL_IPS = [
+ '127.0.0.1', '::1',
+ '172.17.0.1'
+]
#
diff --git a/patchwork/settings/production.example.py b/patchwork/settings/production.example.py
index 03a0fb0..e97ba57 100644
--- a/patchwork/settings/production.example.py
+++ b/patchwork/settings/production.example.py
@@ -11,8 +11,6 @@ from __future__ import absolute_import
import os
-import django
-
from .base import * # noqa
#
@@ -74,6 +72,5 @@ DATABASES = {
STATIC_ROOT = os.environ.get('STATIC_ROOT', '/srv/patchwork/htdocs/static')
-if django.VERSION >= (1, 7):
- STATICFILES_STORAGE = \
- 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
+STATICFILES_STORAGE = (
+ 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage')