# HG changeset patch # User Tero Marttila # Date 1410657412 -10800 # Node ID 1048b9081edc9237eadf3c431cfd0cb0ac2bd460 # Parent 121cf2e6330fff265cf6cca9ac071ae6ad95c1ea qmsk_www split settings with production support diff -r 121cf2e6330f -r 1048b9081edc qmsk_www/settings.py --- a/qmsk_www/settings.py Sun Sep 14 03:54:19 2014 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -""" -Django settings for qmsk_www project. - -For more information on this file, see -https://docs.djangoproject.com/en/1.7/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.7/ref/settings/ -""" - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '&e#@fir!k-*w(=0$@j&0guyv8qq*mh7_55j6w@2=hm0x9^ya-2' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -TEMPLATE_DEBUG = True - -ALLOWED_HOSTS = [] - - -## Application definition -INSTALLED_APPS = ( - 'django.contrib.staticfiles', -) - -MIDDLEWARE_CLASSES = ( - -) - -ROOT_URLCONF = 'qmsk_www.urls' - -WSGI_APPLICATION = 'qmsk_www.wsgi.application' - - -## Database -# https://docs.djangoproject.com/en/1.7/ref/settings/#databases - -DATABASES = { - -} - -## Internationalization -# https://docs.djangoproject.com/en/1.7/topics/i18n/ - -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/1.7/howto/static-files/ -STATIC_URL = '/static/' -STATICFILES_DIRS = ( - './qmsk_www/static', -) - -## Site templates -TEMPLATE_DIRS = ( - './qmsk_www/templates', -) - -## Logging -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'formatters': { - 'qmsk': { - 'format': '[%(levelname)5s] %(module)20s:%(funcName)-20s : %(message)s', - }, - }, - 'handlers': { - 'console': { - 'level': 'DEBUG', - 'class': 'logging.StreamHandler', - 'formatter': 'qmsk', - }, - }, - 'loggers': { - 'qmsk_www_pages': { - 'handlers': [ 'console' ], - 'level': 'INFO', - } - }, -} - -## Custom -INSTALLED_APPS += ( - 'qmsk_www_pages', -) - -QMSK_WWW_PAGES_DIR = './pages' -QMSK_WWW_PAGES_SITE = "qmsk.net" diff -r 121cf2e6330f -r 1048b9081edc qmsk_www/settings/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk_www/settings/__init__.py Sun Sep 14 04:16:52 2014 +0300 @@ -0,0 +1,19 @@ +""" + Django settings for qmsk_www project. + + For more information on this file, see + https://docs.djangoproject.com/en/1.7/topics/settings/ + + For the full list of settings and their values, see + https://docs.djangoproject.com/en/1.7/ref/settings/ +""" + +from qmsk_www.settings.database import * +from qmsk_www.settings.localization import * +from qmsk_www.settings.pages import * +from qmsk_www.settings.site import * + +try: + from qmsk_www.settings.production import * +except ImportError: + from qmsk_www.settings.development import * diff -r 121cf2e6330f -r 1048b9081edc qmsk_www/settings/database.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk_www/settings/database.py Sun Sep 14 04:16:52 2014 +0300 @@ -0,0 +1,6 @@ +## Database +# https://docs.djangoproject.com/en/1.7/ref/settings/#databases +DATABASES = { + +} + diff -r 121cf2e6330f -r 1048b9081edc qmsk_www/settings/development.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk_www/settings/development.py Sun Sep 14 04:16:52 2014 +0300 @@ -0,0 +1,37 @@ +# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '&e#@fir!k-*w(=0$@j&0guyv8qq*mh7_55j6w@2=hm0x9^ya-2' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = [] + +## Logging +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'formatters': { + 'qmsk': { + 'format': '[%(levelname)5s] %(module)20s:%(funcName)-20s : %(message)s', + }, + }, + 'handlers': { + 'console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'qmsk', + }, + }, + 'loggers': { + 'qmsk_www_pages': { + 'handlers': [ 'console' ], + 'level': 'INFO', + } + }, +} + + diff -r 121cf2e6330f -r 1048b9081edc qmsk_www/settings/localization.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk_www/settings/localization.py Sun Sep 14 04:16:52 2014 +0300 @@ -0,0 +1,13 @@ +## Internationalization +# https://docs.djangoproject.com/en/1.7/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + diff -r 121cf2e6330f -r 1048b9081edc qmsk_www/settings/pages.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk_www/settings/pages.py Sun Sep 14 04:16:52 2014 +0300 @@ -0,0 +1,2 @@ +QMSK_WWW_PAGES_DIR = './pages' +QMSK_WWW_PAGES_SITE = "qmsk.net" diff -r 121cf2e6330f -r 1048b9081edc qmsk_www/settings/site.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk_www/settings/site.py Sun Sep 14 04:16:52 2014 +0300 @@ -0,0 +1,27 @@ +## Application definition +INSTALLED_APPS = ( + 'django.contrib.staticfiles', + + 'qmsk_www_pages', +) + +MIDDLEWARE_CLASSES = ( + +) + +ROOT_URLCONF = 'qmsk_www.urls' + +WSGI_APPLICATION = 'qmsk_www.wsgi.application' + +## Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.7/howto/static-files/ +STATIC_URL = '/static/' +STATICFILES_DIRS = ( + './qmsk_www/static', +) + +## Site templates +TEMPLATE_DIRS = ( + './qmsk_www/templates', +) +