From 435907732bac7a3eb52377b303e7a446a6ad7201 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 23 Nov 2016 17:22:23 +0000 Subject: [PATCH] cleanup settings --- project/settings.py | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/project/settings.py b/project/settings.py index 0931183..10854ba 100755 --- a/project/settings.py +++ b/project/settings.py @@ -1,22 +1,6 @@ -""" -Django settings for project project. - -Generated by 'django-admin startproject' using Django 1.10.3. - -For more information on this file, see -https://docs.djangoproject.com/en/1.10/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.10/ref/settings/ -""" - -from __future__ import absolute_import, unicode_literals - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os -PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -BASE_DIR = PROJECT_DIR +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ALLOWED_HOSTS = ['*'] @@ -65,6 +49,10 @@ INSTALLED_APPS = [ ] MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + + 'whitenoise.middleware.WhiteNoiseMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -72,9 +60,6 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'django.middleware.security.SecurityMiddleware', - - 'whitenoise.middleware.WhiteNoiseMiddleware', 'wagtail.wagtailcore.middleware.SiteMiddleware', 'wagtail.wagtailredirects.middleware.RedirectMiddleware', @@ -86,7 +71,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ - os.path.join(PROJECT_DIR, 'templates'), + os.path.join(BASE_DIR, 'templates'), ], 'APP_DIRS': True, 'OPTIONS': { @@ -118,7 +103,7 @@ DATABASES = { # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'en-GB' TIME_ZONE = 'UTC' @@ -130,7 +115,7 @@ USE_TZ = True STATICFILES_DIRS = [ - os.path.join(PROJECT_DIR, 'static'), + os.path.join(BASE_DIR, 'static'), ] STATIC_ROOT = os.path.join(BASE_DIR, 'collected-static')