|
@@ -1,6 +1,8 @@
|
|
|
"""
|
|
|
Django settings for {{ project_name }} project.
|
|
|
|
|
|
+Generated by 'django-admin startproject' using Django {{ django_version }}.
|
|
|
+
|
|
|
For more information on this file, see
|
|
|
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
|
|
|
|
|
@@ -8,30 +10,16 @@ For the full list of settings and their values, see
|
|
|
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
|
|
|
"""
|
|
|
|
|
|
-from os.path import abspath, dirname, join
|
|
|
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
+import os
|
|
|
|
|
|
-# Absolute filesystem path to the Django project directory:
|
|
|
-PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__))))
|
|
|
+PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
+BASE_DIR = os.path.dirname(PROJECT_DIR)
|
|
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
|
# See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/
|
|
|
|
|
|
-# SECURITY WARNING: keep the secret key used in production secret!
|
|
|
-SECRET_KEY = '{{ secret_key }}'
|
|
|
-
|
|
|
-# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
-DEBUG = True
|
|
|
-
|
|
|
-TEMPLATE_DEBUG = True
|
|
|
-
|
|
|
-ALLOWED_HOSTS = []
|
|
|
-
|
|
|
-
|
|
|
-# Base URL to use when referring to full URLs within the Wagtail admin backend -
|
|
|
-# e.g. in notification emails. Don't include '/admin' or a trailing slash
|
|
|
-BASE_URL = 'http://example.com'
|
|
|
-
|
|
|
|
|
|
# Application definition
|
|
|
|
|
@@ -43,23 +31,24 @@ INSTALLED_APPS = (
|
|
|
'django.contrib.messages',
|
|
|
'django.contrib.staticfiles',
|
|
|
|
|
|
- 'compressor',
|
|
|
'taggit',
|
|
|
+ 'compressor',
|
|
|
'modelcluster',
|
|
|
|
|
|
'wagtail.wagtailcore',
|
|
|
'wagtail.wagtailadmin',
|
|
|
+ 'wagtail.wagtailsearch',
|
|
|
+ 'wagtail.wagtailimages',
|
|
|
'wagtail.wagtaildocs',
|
|
|
'wagtail.wagtailsnippets',
|
|
|
'wagtail.wagtailusers',
|
|
|
'wagtail.wagtailsites',
|
|
|
- 'wagtail.wagtailimages',
|
|
|
'wagtail.wagtailembeds',
|
|
|
- 'wagtail.wagtailsearch',
|
|
|
'wagtail.wagtailredirects',
|
|
|
'wagtail.wagtailforms',
|
|
|
|
|
|
- 'core',
|
|
|
+ 'search',
|
|
|
+ 'home',
|
|
|
)
|
|
|
|
|
|
MIDDLEWARE_CLASSES = (
|
|
@@ -67,92 +56,83 @@ MIDDLEWARE_CLASSES = (
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
+ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
+ 'django.middleware.security.SecurityMiddleware',
|
|
|
|
|
|
'wagtail.wagtailcore.middleware.SiteMiddleware',
|
|
|
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
|
|
|
)
|
|
|
|
|
|
ROOT_URLCONF = '{{ project_name }}.urls'
|
|
|
+
|
|
|
+TEMPLATES = [
|
|
|
+ {
|
|
|
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
+ 'DIRS': [
|
|
|
+ os.path.join(PROJECT_DIR, 'templates'),
|
|
|
+ ],
|
|
|
+ 'APP_DIRS': True,
|
|
|
+ 'OPTIONS': {
|
|
|
+ 'context_processors': [
|
|
|
+ 'django.template.context_processors.debug',
|
|
|
+ 'django.template.context_processors.request',
|
|
|
+ 'django.contrib.auth.context_processors.auth',
|
|
|
+ 'django.contrib.messages.context_processors.messages',
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
|
|
|
|
|
|
|
|
|
# Database
|
|
|
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
|
|
|
|
|
|
-# SQLite (simplest install)
|
|
|
DATABASES = {
|
|
|
'default': {
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
- 'NAME': join(PROJECT_ROOT, 'db.sqlite3'),
|
|
|
+ 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-# PostgreSQL (Recommended, but requires the psycopg2 library and Postgresql development headers)
|
|
|
-# DATABASES = {
|
|
|
-# 'default': {
|
|
|
-# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
-# 'NAME': '{{ project_name }}',
|
|
|
-# 'USER': 'postgres',
|
|
|
-# 'PASSWORD': '',
|
|
|
-# 'HOST': '', # Set to empty string for localhost.
|
|
|
-# 'PORT': '', # Set to empty string for default.
|
|
|
-# 'CONN_MAX_AGE': 600, # number of seconds database connections should persist for
|
|
|
-# }
|
|
|
-# }
|
|
|
-
|
|
|
|
|
|
# Internationalization
|
|
|
# https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
|
|
|
|
|
|
-LANGUAGE_CODE = 'en-gb'
|
|
|
+LANGUAGE_CODE = 'en-us'
|
|
|
+
|
|
|
TIME_ZONE = 'UTC'
|
|
|
+
|
|
|
USE_I18N = True
|
|
|
+
|
|
|
USE_L10N = True
|
|
|
+
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
# https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
|
|
|
|
|
|
-STATIC_ROOT = join(PROJECT_ROOT, 'static')
|
|
|
-STATIC_URL = '/static/'
|
|
|
-
|
|
|
STATICFILES_FINDERS = (
|
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
|
'compressor.finders.CompressorFinder',
|
|
|
)
|
|
|
|
|
|
-MEDIA_ROOT = join(PROJECT_ROOT, 'media')
|
|
|
-MEDIA_URL = '/media/'
|
|
|
-
|
|
|
-
|
|
|
-# Template configuration
|
|
|
+STATICFILES_DIRS = (
|
|
|
+ os.path.join(PROJECT_DIR, 'static'),
|
|
|
+)
|
|
|
|
|
|
-from django.conf import global_settings
|
|
|
+STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
|
|
+STATIC_URL = '/static/'
|
|
|
|
|
|
-TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
|
|
|
- 'django.core.context_processors.request',
|
|
|
-)
|
|
|
+MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
|
|
+MEDIA_URL = '/media/'
|
|
|
|
|
|
|
|
|
# Wagtail settings
|
|
|
|
|
|
WAGTAIL_SITE_NAME = "{{ project_name }}"
|
|
|
-
|
|
|
-# Use Elasticsearch as the search backend for extra performance and better search results:
|
|
|
-# http://wagtail.readthedocs.org/en/latest/howto/performance.html#search
|
|
|
-# http://wagtail.readthedocs.org/en/latest/core_components/search/backends.html#elasticsearch-backend
|
|
|
-#
|
|
|
-# WAGTAILSEARCH_BACKENDS = {
|
|
|
-# 'default': {
|
|
|
-# 'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
|
|
|
-# 'INDEX': '{{ project_name }}',
|
|
|
-# },
|
|
|
-# }
|
|
|
-
|
|
|
-
|
|
|
-# Whether to use face/feature detection to improve image cropping - requires OpenCV
|
|
|
-WAGTAILIMAGES_FEATURE_DETECTION_ENABLED = False
|