From bb975e0eb22722c9c54c484c1da169c19c3f7e67 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Mon, 14 Sep 2015 16:55:41 +0200 Subject: [PATCH] Zmena rozlisovani nastaveni * Bez prepisovani * Mozna pochrouma push_* pred deployem --- mamweb/settings.py | 36 +++++++++++++----------------------- mamweb/settings_local.py | 38 ++++++++++++++++++++++++++++++++++++++ mamweb/settings_prod.py | 12 +++++++++++- mamweb/settings_test.py | 13 ++++++++++++- 4 files changed, 74 insertions(+), 25 deletions(-) create mode 100644 mamweb/settings_local.py diff --git a/mamweb/settings.py b/mamweb/settings.py index e1b17817..8eb9bd97 100644 --- a/mamweb/settings.py +++ b/mamweb/settings.py @@ -1,30 +1,20 @@ import os.path -from .settings_common import * -# Local development settings +# +# "Chytre" rozliseni, zda je toto produkcni, testovaci ci +# jina/vyvojova/lokalni instance. +# +# Je mozne tez rozhodnout primo pomoci: +# DJANGO_SETTINGS_MODULE=mamweb.settings_ZZZ ./manage.py ... +# -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ +if os.path.abspath(__file__).startswith('/akce/MaM/WWW/mamweb-test/'): + from .settings_test import * -INSTALLED_APPS += ( - 'debug_toolbar', - 'django_extensions', - ) +elif os.path.abspath(__file__).startswith('/akce/MaM/WWW/mamweb/'): + from .settings_prod import * -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +else: + from .settings_local import * -TEMPLATE_DEBUG = True - -ALLOWED_HOSTS = ['127.0.0.1'] - -# Database -# https://docs.djangoproject.com/en/1.7/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db-local.sqlite3'), - } -} diff --git a/mamweb/settings_local.py b/mamweb/settings_local.py new file mode 100644 index 00000000..f55679f8 --- /dev/null +++ b/mamweb/settings_local.py @@ -0,0 +1,38 @@ +import os.path + +# +# Lokalni / vyvojove nastaveni settings.py +# +# Pro vyber tohoto nastaveni muzete pouzit tez: +# DJANGO_SETTINGS_MODULE=mamweb.settings_local ./manage.py ... +# + +# Import common settings +from .settings_common import * + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ + +INSTALLED_APPS += ( + 'debug_toolbar', + 'django_extensions', + ) + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = ['127.0.0.1'] + +# Database +# https://docs.djangoproject.com/en/1.7/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db-local.sqlite3'), + } +} + diff --git a/mamweb/settings_prod.py b/mamweb/settings_prod.py index 48672434..8535389d 100644 --- a/mamweb/settings_prod.py +++ b/mamweb/settings_prod.py @@ -1,7 +1,17 @@ # -*- coding: utf-8 -*- + +import os.path + +# +# Produkcni nastaveni settings.py +# +# Pro vyber tohoto nastaveni muzete pouzit tez: +# DJANGO_SETTINGS_MODULE=mamweb.settings_prod ./manage.py ... +# + +# Import common settings from .settings_common import * -# Specific settings for remote production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ diff --git a/mamweb/settings_test.py b/mamweb/settings_test.py index 50bff36e..f18a419f 100644 --- a/mamweb/settings_test.py +++ b/mamweb/settings_test.py @@ -1,6 +1,17 @@ +# -*- coding: utf-8 -*- + +import os.path + +# +# Testovaci nastaveni settings.py (testovani na atreyi) +# +# Pro vyber tohoto nastaveni muzete pouzit tez: +# DJANGO_SETTINGS_MODULE=mamweb.settings_test ./manage.py ... +# + +# Import common settings from .settings_common import * -# Specific settings for remote test site # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/