settings: adapting settings for django1.7

- Fixed: call to local.local_settings module.
- Added: TEMPLATE_CONTEXT_PROCESSORS tuple,
     django 1.7 requirement.
- Added: SITE_ID variable.
- Added: 'django.contrib.sites' to INSTALLED_APPS
     tuple for django 1.7 compatibility.
- Fixed: Languages code settings.

Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
rascencio 2015-05-20 22:38:22 -06:00
parent b9deacad4e
commit 7a386806f9
2 changed files with 28 additions and 16 deletions

View file

@ -1,18 +1,11 @@
""" """
Django settings for dynamicweb project. Copyright 2015 Ungleich.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
""" """
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os import os
import logging
import django.db.backends.postgresql_psycopg2 import django.db.backends.postgresql_psycopg2
@ -22,6 +15,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
SITE_ID = 4047
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xlhyv_l5-z6e8_@q6)n0up1a0$5-aad7d)om2t8g$bi6*@q44i' SECRET_KEY = 'xlhyv_l5-z6e8_@q6)n0up1a0$5-aad7d)om2t8g$bi6*@q44i'
@ -42,13 +37,13 @@ INSTALLED_APPS = (
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.sites',
'digital_glarus', 'digital_glarus',
'cms', # django CMS itself 'cms', # django CMS itself
'treebeard', # utilities for implementing a tree 'treebeard', # utilities for implementing a tree
'menus', # helper for model independent hierarchical website navigation 'menus', # helper for model independent hierarchical website navigation
'sekizai', # for javascript and css management 'sekizai', # for javascript and css management
'djangocms_admin_style', # for the admin skin. You **must** add 'djangocms_admin_style' in the list **before** 'django.contrib.admin'. 'djangocms_admin_style', # for the admin skin. You **must** add 'djangocms_admin_style' in the list **before** 'django.contrib.admin'.
'django.contrib.messages', # to enable messages framework (see :ref:`Enable messages <enable-messages>`)
#django-cms plugins #django-cms plugins
'djangocms_flash', 'djangocms_flash',
'djangocms_googlemap', 'djangocms_googlemap',
@ -60,7 +55,6 @@ INSTALLED_APPS = (
'cmsplugin_filer_file', 'cmsplugin_filer_file',
'cmsplugin_filer_folder', 'cmsplugin_filer_folder',
'cmsplugin_filer_link', 'cmsplugin_filer_link',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser', 'cmsplugin_filer_teaser',
'cmsplugin_filer_video', 'cmsplugin_filer_video',
# versioning # versioning
@ -113,6 +107,19 @@ TEMPLATES = [
WSGI_APPLICATION = 'dynamicweb.wsgi.application' WSGI_APPLICATION = 'dynamicweb.wsgi.application'
# Deprecated since version 1.8.
# callables take a request object as their argument and return a dictionary of
# items to be merged into the context.
TEMPLATE_CONTEXT_PROCESSORS = (
"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",
"django.core.context_processors.request",
)
# Database # Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
@ -125,9 +132,13 @@ DATABASES = {
} }
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/ # https://docs.djangoproject.com/en/1.7/topics/i18n/
LANGUAGE_CODE = 'en-us' LANGUAGES = (
('en', 'English'),
)
LANGUAGE_CODE = 'en'
TIME_ZONE = 'UTC' TIME_ZONE = 'UTC'
@ -139,7 +150,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/ # https://docs.djangoproject.com/en/1.7/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
@ -147,6 +158,6 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static')
try: try:
from local.local_settings import * # noqa from .local.local_settings import *
except ImportError: except ImportError:
logging.warning("No local_settings file found.") logging.warning("No local_settings file found.")

View file

@ -12,9 +12,10 @@ django-treebeard==3.0
django-sekizai==0.7 django-sekizai==0.7
django-classy-tags==0.5 django-classy-tags==0.5
django-filer==0.9.9 django-filer==0.9.9
django-reversion
# django-cms # django-cms
django-cms>=3 django-cms>=3.0
# django-cms-plugins # django-cms-plugins
djangocms-admin-style==0.2.2 djangocms-admin-style==0.2.2