Update settings.py config databases for demo and prod

remotes/origin/pm_task_31703
Zolotarev Alexander 9 years ago
parent 01f7521d98
commit 2102eb6f57
  1. 339
      lms/settings.py

@ -1,169 +1,170 @@
# coding=utf-8 # coding=utf-8
import os import os
import raven import raven
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 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.9/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '!eiquy7_+2#vn3z%zfp51$m-=tmvtcv*cj*@x$!v(_9btq0w=$' SECRET_KEY = '!eiquy7_+2#vn3z%zfp51$m-=tmvtcv*cj*@x$!v(_9btq0w=$'
COMMENT_SECRET = 'ntyy70()&^&%)_^%#++i[k,q4jnb' COMMENT_SECRET = 'ntyy70()&^&%)_^%#++i[k,q4jnb'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False DEBUG = False
TESTING = False TESTING = False
TEST_EMAIL = 'bez.b.unix@gmail.com' TEST_EMAIL = 'bez.b.unix@gmail.com'
TEACHER = 't@skillbox.ru' TEACHER = 't@skillbox.ru'
SUPERVISOR = 's@skillbox.ru' SUPERVISOR = 's@skillbox.ru'
MANAGER = 'm@skillbox.ru' MANAGER = 'm@skillbox.ru'
SUPPORT = 'hello@skillbox.ru' SUPPORT = 'hello@skillbox.ru'
SUPPORT_PHONE = '+7 (495) 984-41-77' SUPPORT_PHONE = '+7 (495) 984-41-77'
SUPPORT_TIME = '(с 10 до 19 по Москве)' SUPPORT_TIME = '(с 10 до 19 по Москве)'
ADDRESS = 'Москва, ул. Бауманская, д. 11' ADDRESS = 'Москва, ул. Бауманская, д. 11'
AUTH_USER_MODEL = 'access.User' AUTH_USER_MODEL = 'access.User'
VZAAR = 'f1e965defc6fbaa92c544cf84267e830' VZAAR = 'f1e965defc6fbaa92c544cf84267e830'
SMS = '5ED9C6BB-41E8-C760-10FA-F8A310D88952' SMS = '5ED9C6BB-41E8-C760-10FA-F8A310D88952'
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
DOMAIN = 'https://go.skillbox.ru' DOMAIN = 'https://go.skillbox.ru'
NAME = u'SkillBox - обучающая платформа' NAME = u'SkillBox - обучающая платформа'
BROKER_URL = 'amqp://guest:guest@localhost:5672//' BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_ACCEPT_CONTENT = ['json'] CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json' CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json'
CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
BILL_LOGIN = '1501' BILL_LOGIN = '1501'
BILL_URL = 'https://api.simplepay.pro/sp/payment' BILL_URL = 'https://api.simplepay.pro/sp/payment'
BILL_KEY = u'848360a6b0b8cdfaca3603ede75e4d8b' BILL_KEY = u'848360a6b0b8cdfaca3603ede75e4d8b'
BILL_RESULT_KEY = u'82a513fc6a0bd9cb087e0df4be5520f6' BILL_RESULT_KEY = u'82a513fc6a0bd9cb087e0df4be5520f6'
BILL_TOKEN = u'c63fc7fdc74de318e1f9b078b6d4406a3e62f522b00fb305afe61c0ead238eb9c88dcab6b324727537fe5c1631cba3a9bcb76955364aa269334b42fb4099d236' BILL_TOKEN = u'c63fc7fdc74de318e1f9b078b6d4406a3e62f522b00fb305afe61c0ead238eb9c88dcab6b324727537fe5c1631cba3a9bcb76955364aa269334b42fb4099d236'
AMO_USER_LOGIN = 'baryshnikov@mokselle.com' AMO_USER_LOGIN = 'baryshnikov@mokselle.com'
AMO_USER_HASH = 'd639c26c1c1900e5a8cee66cd3395bdc' AMO_USER_HASH = 'd639c26c1c1900e5a8cee66cd3395bdc'
AMO_SUBDOMAIN = 'mokselle' AMO_SUBDOMAIN = 'mokselle'
EMAIL_HOST = 'smtp.yandex.ru' EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_HOST_PASSWORD = 'nu5Xefise' EMAIL_HOST_PASSWORD = 'nu5Xefise'
EMAIL_HOST_USER = 'robo@skill-box.ru' EMAIL_HOST_USER = 'robo@skill-box.ru'
EMAIL_PORT = '587' EMAIL_PORT = '587'
EMAIL_USE_TLS = True EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'robo@skill-box.ru' DEFAULT_FROM_EMAIL = 'robo@skill-box.ru'
YANDEX_MONEY_SHOP_PASSWORD = 'nu5Xefise' YANDEX_MONEY_SHOP_PASSWORD = 'nu5Xefise'
YANDEX_SHOP_ID = '84348' YANDEX_SHOP_ID = '84348'
YANDEX_scid = '78309' YANDEX_scid = '78309'
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
#'jet.dashboard', #'jet.dashboard',
#'jet', #'jet',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'access', 'access',
'courses', 'courses',
'storage', 'storage',
'management', 'management',
'finance', 'finance',
'djcelery', 'djcelery',
'redactor', 'redactor',
'raven.contrib.django.raven_compat', 'raven.contrib.django.raven_compat',
'journals', 'journals',
'service', 'service',
'import_export', 'import_export',
'library', 'library',
'practice', 'practice',
'precise_bbcode', 'precise_bbcode',
] ]
MIDDLEWARE_CLASSES = [ MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
] ]
ROOT_URLCONF = 'lms.urls' ROOT_URLCONF = 'lms.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')] 'DIRS': [os.path.join(BASE_DIR, 'templates')]
, ,
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [
'django.template.context_processors.debug', 'django.template.context_processors.debug',
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth', 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
], ],
}, },
}, },
] ]
WSGI_APPLICATION = 'lms.wsgi.application' WSGI_APPLICATION = 'lms.wsgi.application'
# Database # Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
DATABASES = { DATABASES = {
'default': { 'default': {
'HOST': '192.168.0.2', 'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': os.environ.get('DB_NAME', 'codemy'),
'NAME': 'codemy', 'USER': os.environ.get('PG_ENV_POSTGRES_USER', 'team'),
'USER': 'team', 'PASSWORD': os.environ.get('PG_ENV_POSTGRES_PASSWORD', 'nu5Xefise'),
'PASSWORD': 'nu5Xefise' 'HOST': os.environ.get('PG_PORT_5432_TCP_ADDR', '77.244.221.176'),
} 'PORT': os.environ.get('PG_PORT_5432_TCP_PORT', '5432'),
} },
}
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators # Password validation
AUTHENTICATION_BACKENDS = ['lms.CUSTOM_AUTH.ModelBackend'] # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [ AUTHENTICATION_BACKENDS = ['lms.CUSTOM_AUTH.ModelBackend']
{ AUTH_PASSWORD_VALIDATORS = [
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', {
}, 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
{ },
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', {
}, 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
{ },
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', {
}, 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
{ },
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', {
}, 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
] },
]
# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/ # Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/
LANGUAGE_CODE = 'ru-ru'
TIME_ZONE = 'Europe/Moscow' LANGUAGE_CODE = 'ru-ru'
USE_I18N = True TIME_ZONE = 'Europe/Moscow'
USE_L10N = True USE_I18N = True
USE_TZ = False USE_L10N = True
USE_TZ = False
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/ # Static files (CSS, JavaScript, Images)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') # https://docs.djangoproject.com/en/1.9/howto/static-files/
MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
STATIC_ROOT = os.path.join(BASE_DIR, 'static/') MEDIA_URL = '/media/'
STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
REDACTOR_OPTIONS = {'lang': 'ru'} STATIC_URL = '/static/'
REDACTOR_UPLOAD = 'uploads/' REDACTOR_OPTIONS = {'lang': 'ru'}
REDACTOR_UPLOAD = 'uploads/'
RAVEN_CONFIG = {
'dsn': 'http://56855e5263f04dbda3e97fb9c950cb45:02ceda8b67bc45fb800754958bca7883@s.codemy.ru/2' RAVEN_CONFIG = {
} 'dsn': 'http://56855e5263f04dbda3e97fb9c950cb45:02ceda8b67bc45fb800754958bca7883@s.codemy.ru/2'
}

Loading…
Cancel
Save