From b77d1db9119dcd13cb65b8db95e6ce11afc877b6 Mon Sep 17 00:00:00 2001 From: rscnt Date: Wed, 20 May 2015 20:57:22 -0600 Subject: [PATCH] settings: added local_settings. Signed-off-by: rscnt --- dynamicweb/local/__init__.py | 0 dynamicweb/local/local_settings.py.example | 13 +++++++++++++ dynamicweb/settings.py | 13 ++++++++----- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 dynamicweb/local/__init__.py create mode 100644 dynamicweb/local/local_settings.py.example diff --git a/dynamicweb/local/__init__.py b/dynamicweb/local/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/dynamicweb/local/local_settings.py.example b/dynamicweb/local/local_settings.py.example new file mode 100644 index 00000000..c2bfcd51 --- /dev/null +++ b/dynamicweb/local/local_settings.py.example @@ -0,0 +1,13 @@ +from settings import SITE_ROOT + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'db_name', + 'USER': 'username', + 'PASSWORD': 'password', + } +} diff --git a/dynamicweb/settings.py b/dynamicweb/settings.py index fa58a83c..be7b3e46 100644 --- a/dynamicweb/settings.py +++ b/dynamicweb/settings.py @@ -10,12 +10,14 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ +# -*- coding: utf-8 -*- # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import django.db.backends.postgresql_psycopg2 -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +gettext = lambda s: s +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ @@ -27,7 +29,7 @@ SECRET_KEY = 'xlhyv_l5-z6e8_@q6)n0up1a0$5-aad7d)om2t8g$bi6*@q44i' DEBUG = False ALLOWED_HOSTS = [ - ".ungleich.ch", + ".ungleich.ch", "digital.glarus.ungleich.ch" ] @@ -106,7 +108,8 @@ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') + try: - from .settings_local import * -except ImportError as e: - pass + from local.local_settings import * # noqa +except ImportError: + logging.warning("No local_settings file found.")