From a29510929b055c50bbc6b0bd82f6c05e825bc979 Mon Sep 17 00:00:00 2001 From: Gena Date: Mon, 1 Jun 2015 18:34:29 +0600 Subject: [PATCH] no message --- .gitignore | 14 ++++++++++++++ batiskaf/settings.py | 39 ++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1aff8b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.pyc +*.pyo +.idea +.idea/workspace.xml +*.sublime-project +*.sublime-workspace +*.db +*.sqlite3 +media/item_photos/* +media/adminfiles/* +media/cache/* +static/item_photos/* +static/adminfiles/* +static/cache/* diff --git a/batiskaf/settings.py b/batiskaf/settings.py index 7f39e1f..66e20cc 100644 --- a/batiskaf/settings.py +++ b/batiskaf/settings.py @@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/1.7/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os from django.contrib.messages import constants as messages +import platform + BASE_DIR = os.path.dirname(os.path.dirname(__file__)) @@ -21,11 +23,11 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '3s+98l&+j1d=)t2u86wc)f&v*(hs0fv^xz@ockpq=d(#ncm9yi' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = (platform.node() != 'Batiskaf') -TEMPLATE_DEBUG = True +TEMPLATE_DEBUG = DEBUG -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['batiskaf.kz', 'www.batiskaf.kz'] MESSAGE_TAGS = { messages.INFO: 'info', @@ -71,17 +73,28 @@ WSGI_APPLICATION = 'batiskaf.wsgi.application' # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'batiskaf', - 'USER': 'batiskaf', - 'PASSWORD': 'batiskaf', - 'HOST': '127.0.0.1', - 'PORT': '5432', +if DEBUG: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'batiskaf', + 'USER': 'batiskaf', + 'PASSWORD': 'batiskaf', + 'HOST': '127.0.0.1', + 'PORT': '5432', + } + } +else: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'batiskaf', + 'USER': 'batiskaf', + 'PASSWORD': 'Obr9yIk7ub8Mat8Pew5Y', + 'HOST': '127.0.0.1', + 'PORT': '5432', + } } -} # Internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/