settings.py: handle flake8 warnings

Remove double #'s everywhere, remove spaces between [], place : directly
after the string and correctly indent the TEMPLATES declaration
This commit is contained in:
Jelle van der Waa 2017-06-07 22:05:39 +02:00
parent 85a9f34cc8
commit 61cc984a43

View File

@ -1,11 +1,11 @@
# Django settings for archweb project. # Django settings for archweb project.
from os import path from os import path
## Set the debug values # Set the debug values
DEBUG = False DEBUG = False
DEBUG_TOOLBAR = False DEBUG_TOOLBAR = False
## Notification admins # Notification admins
ADMINS = () ADMINS = ()
# Set managers to admins # Set managers to admins
@ -131,7 +131,7 @@
}, },
} }
## Server used for linking to PGP keysearch results # Server used for linking to PGP keysearch results
PGP_SERVER = 'pgp.mit.edu' PGP_SERVER = 'pgp.mit.edu'
PGP_SERVER_SECURE = True PGP_SERVER_SECURE = True
@ -159,42 +159,42 @@
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE' : 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.sqlite3',
'NAME' : 'database.db', 'NAME': 'database.db',
}, },
} }
## Import local settings # Import local settings
try: try:
from local_settings import * from local_settings import *
except ImportError: except ImportError:
pass pass
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ 'DIRS': [
path.join(DEPLOY_PATH, 'templates') path.join(DEPLOY_PATH, 'templates')
],
'APP_DIRS': True,
'OPTIONS': {
'debug': DEBUG,
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.contrib.messages.context_processors.messages',
'main.context_processors.secure',
], ],
'APP_DIRS': True,
'OPTIONS': {
'debug': DEBUG,
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.contrib.messages.context_processors.messages',
'main.context_processors.secure',
],
}
} }
}
] ]
# Enable the debug toolbar if requested # Enable the debug toolbar if requested
if DEBUG_TOOLBAR: if DEBUG_TOOLBAR:
MIDDLEWARE_CLASSES = \ MIDDLEWARE_CLASSES = \
[ 'debug_toolbar.middleware.DebugToolbarMiddleware' ] + \ ['debug_toolbar.middleware.DebugToolbarMiddleware'] + \
list(MIDDLEWARE_CLASSES) list(MIDDLEWARE_CLASSES)
INSTALLED_APPS = list(INSTALLED_APPS) + [ 'debug_toolbar' ] INSTALLED_APPS = list(INSTALLED_APPS) + ['debug_toolbar']
# vim: set ts=4 sw=4 et: # vim: set ts=4 sw=4 et: