You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

274 lines
8.1 KiB

"""
Django settings for batiskaf 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/
"""
# 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__))
ADMINS = (
('spacenergy', 'spacenergy@me.com'),
)
MANAGERS = (
('spacenergy', 'spacenergy@me.com'),
('admin', 'admin@batiskaf-kz.kz'),
)
# 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 = '3s+98l&+j1d=)t2u86wc)f&v*(hs0fv^xz@ockpq=d(#ncm9yi'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = (platform.node() != 'Batiskaf')
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['batiskaf.kz', 'www.batiskaf.kz', 'batiskaf-kz.kz', 'www.batiskaf-kz.kz']
MESSAGE_TAGS = {
messages.INFO: 'info',
messages.WARNING: 'warning',
messages.ERROR: 'error',
messages.SUCCESS: 'success',
}
AUTH_USER_MODEL = 'accounts.Profile'
LOGIN_URL = '/account/login/'
LOGOUT_URL = '/account/logout/'
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.postgres',
'django.contrib.sitemaps',
'django.contrib.sites',
'django_extensions',
'rest_framework',
'easy_thumbnails',
'bootstrapform_jinja',
'kkb',
'batiskaf',
'main',
'accounts',
'store',
'news',
)
SITE_ID = 1
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'batiskaf.urls'
WSGI_APPLICATION = 'batiskaf.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
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',
}
}
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_HOST_USER = 'admin@batiskaf-kz.kz'
EMAIL_HOST_PASSWORD = 'Gek5eAw6Aj0haig3vewM'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = "admin@batiskaf-kz.kz"
SERVER_EMAIL = "admin@batiskaf-kz.kz"
# admin user hOilk5Ewd9Om4bYpt1At
# admin@batiskaf-kz.kz Gek5eAw6Aj0haig3vewM
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
LANGUAGE_CODE = 'ru'
TIME_ZONE = 'Asia/Almaty'
USE_I18N = True
USE_L10N = False
USE_TZ = False
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
MEDIA_ROOT = os.path.join(BASE_DIR, "static")
STATIC_URL = '/static/'
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder"
]
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'DIRS': [
os.path.join(BASE_DIR, "batiskaf/templates/jinja2"),
# os.path.join(BASE_DIR, "batiskaf/templates/jinja2/bootstrapform"),
],
'OPTIONS': {
'environment': 'batiskaf.jinja2.environment',
}
},
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, "batiskaf/templates"), ],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.core.context_processors.request",
"django.contrib.messages.context_processors.messages",
)
},
},
]
BOOTSTRAP3 = {
# The complete URL to the Bootstrap CSS file (None means derive it from
# base_url)
'css_url': None,
# The complete URL to the Bootstrap CSS file (None means no theme)
'theme_url': None,
# The complete URL to the Bootstrap JavaScript file (None means derive it
# from base_url)
'javascript_url': None,
# Put JavaScript in the HEAD section of the HTML document (only relevant
# if you use bootstrap3.html)
'javascript_in_head': False,
# Include jQuery with Bootstrap JavaScript (affects django-bootstrap3
# template tags)
'include_jquery': False,
# Label class to use in horizontal forms
'horizontal_label_class': 'col-xs-2',
# Field class to use in horizontal forms
'horizontal_field_class': 'col-xs-10',
# Set HTML required attribute on required fields
'set_required': True,
# Set placeholder attributes to label if no placeholder is provided
'set_placeholder': True,
# Class to indicate required (better to set this in your Django form)
'required_css_class': '',
# Class to indicate error (better to set this in your Django form)
'error_css_class': 'has-error',
# Class to indicate success, meaning the field has valid input (better to
# set this in your Django form)
'success_css_class': 'has-success',
# Renderers (only set these if you have studied the source and understand
# the inner workings)
'formset_renderers': {
'default': 'bootstrap3.renderers.FormsetRenderer',
},
'form_renderers': {
'default': 'bootstrap3.renderers.FormRenderer',
},
'field_renderers': {
'default': 'bootstrap3.renderers.FieldRenderer',
'inline': 'bootstrap3.renderers.InlineFieldRenderer',
},
}
BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
CELERY_SEND_TASK_ERROR_EMAILS = True
if DEBUG:
EMAIL_BACKEND = 'main.backends.email_backends.EmailBackend'
EMAIL_FILE_PATH = 'tmp/eml/'
GRAPPELLI_ADMIN_TITLE = 'Батискаф'
GRAPPELLI_SWITCH_USER = True
GRAPPELLI_CLEAN_INPUT_TYPES = False
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.scale_and_crop',
'easy_thumbnails.processors.background',
)
PROFILE_TEMP_PASSWORD = 'dE6Hyo9heWck5yiM2dIs'
MERCHANT_CERTIFICATE_ID = "c183d5b8" # ; Серийный номер сертификата Cert Serial Number
MERCHANT_NAME = "BATISKAF-KZ.KZ" # ; Название магазина (продавца) Shop/merchant Name
PRIVATE_KEY_FN = os.path.join(BASE_DIR, 'kkb_keys', 'cert.prv') # "../paysys/cert.prv" # ; Путь к закрытому ключу Private cert path
PRIVATE_KEY_PASS = "1q2w3e4r" # ; Пароль к закрытому ключу Private cert password
# XML_TEMPLATE_FN = "../paysys/template.xml" # ; Путь к XML шаблону XML template path
# XML_COMMAND_TEMPLATE_FN = "../paysys/command_template.xml" # ; Путь к XML шаблону для команд (возврат/подтверждение)
PUBLIC_KEY_FN = os.path.join(BASE_DIR, 'kkb_keys',
'cert.pub') # "../paysys/kkbca.pem" # ; Путь к открытому ключу Public cert path
MERCHANT_ID = "92210431" # ; Терминал ИД в банковской Системе