239 lines
6.4 KiB
Python
239 lines
6.4 KiB
Python
import os # isort:skip
|
|
gettext = lambda s: s
|
|
DATA_DIR = os.path.dirname(os.path.dirname(__file__))
|
|
"""
|
|
Django settings for mysite project.
|
|
|
|
Generated by 'django-admin startproject' using Django 2.2.9.
|
|
|
|
For more information on this file, see
|
|
https://docs.djangoproject.com/en/2.2/topics/settings/
|
|
|
|
For the full list of settings and their values, see
|
|
https://docs.djangoproject.com/en/2.2/ref/settings/
|
|
"""
|
|
|
|
import os
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
SECRET_KEY = '15-d*6bl(@+jfo92@=67vi1ohx%3e&^l98*bo*v$$+ms%!l(!!'
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = True
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'mysite.urls'
|
|
|
|
|
|
|
|
WSGI_APPLICATION = 'mysite.wsgi.application'
|
|
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
|
|
|
|
|
|
|
|
|
# Password validation
|
|
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
},
|
|
]
|
|
|
|
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/2.2/topics/i18n/
|
|
|
|
LANGUAGE_CODE = 'ru'
|
|
|
|
TIME_ZONE = 'Europe/Prague'
|
|
|
|
USE_I18N = True
|
|
|
|
USE_L10N = True
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
|
|
|
STATIC_URL = '/static/'
|
|
MEDIA_URL = '/media/'
|
|
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
|
|
STATIC_ROOT = os.path.join(DATA_DIR, 'static')
|
|
|
|
STATICFILES_DIRS = (
|
|
os.path.join(BASE_DIR, 'mysite', 'static'),
|
|
)
|
|
SITE_ID = 1
|
|
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'DIRS': [os.path.join(BASE_DIR, 'mysite', 'templates'),],
|
|
'OPTIONS': {
|
|
'context_processors': [
|
|
'django.contrib.auth.context_processors.auth',
|
|
'django.contrib.messages.context_processors.messages',
|
|
'django.template.context_processors.i18n',
|
|
'django.template.context_processors.debug',
|
|
'django.template.context_processors.request',
|
|
'django.template.context_processors.media',
|
|
'django.template.context_processors.csrf',
|
|
'django.template.context_processors.tz',
|
|
'sekizai.context_processors.sekizai',
|
|
'django.template.context_processors.static',
|
|
'cms.context_processors.cms_settings'
|
|
],
|
|
'loaders': [
|
|
'django.template.loaders.filesystem.Loader',
|
|
'django.template.loaders.app_directories.Loader'
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
|
|
MIDDLEWARE = [
|
|
'cms.middleware.utils.ApphookReloadMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
'cms.middleware.user.CurrentUserMiddleware',
|
|
'cms.middleware.page.CurrentPageMiddleware',
|
|
'cms.middleware.toolbar.ToolbarMiddleware',
|
|
'cms.middleware.language.LanguageCookieMiddleware'
|
|
]
|
|
|
|
INSTALLED_APPS = [
|
|
'djangocms_admin_style',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.admin',
|
|
'django.contrib.sites',
|
|
'django.contrib.sitemaps',
|
|
'django.contrib.staticfiles',
|
|
'django.contrib.messages',
|
|
'cms',
|
|
'menus',
|
|
'sekizai',
|
|
'treebeard',
|
|
'djangocms_text_ckeditor',
|
|
'filer',
|
|
'easy_thumbnails',
|
|
# 'djangocms_bootstrap4',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_alerts',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_badge',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_card',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_carousel',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_collapse',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_content',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_grid',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_jumbotron',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_link',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_listgroup',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_media',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_picture',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_tabs',
|
|
# 'djangocms_bootstrap4.contrib.bootstrap4_utilities',
|
|
'djangocms_file',
|
|
'djangocms_icon',
|
|
'djangocms_link',
|
|
'djangocms_picture',
|
|
'djangocms_style',
|
|
'djangocms_snippet',
|
|
'djangocms_googlemap',
|
|
'djangocms_video',
|
|
'mysite'
|
|
]
|
|
|
|
LANGUAGES = (
|
|
## Customize this
|
|
('ru', gettext('ru')),
|
|
)
|
|
|
|
CMS_LANGUAGES = {
|
|
## Customize this
|
|
1: [
|
|
{
|
|
'code': 'ru',
|
|
'name': gettext('ru'),
|
|
'redirect_on_fallback': True,
|
|
'public': True,
|
|
'hide_untranslated': False,
|
|
},
|
|
],
|
|
'default': {
|
|
'redirect_on_fallback': True,
|
|
'public': True,
|
|
'hide_untranslated': False,
|
|
},
|
|
}
|
|
|
|
CMS_TEMPLATES = (
|
|
## Customize this
|
|
('fullwidth.html', 'Fullwidth'),
|
|
('sidebar_left.html', 'Sidebar Left'),
|
|
('sidebar_right.html', 'Sidebar Right')
|
|
)
|
|
|
|
CMS_PERMISSION = False
|
|
|
|
CMS_PLACEHOLDER_CONF = {}
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'CONN_MAX_AGE': 0,
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'HOST': 'localhost',
|
|
'NAME': 'project.db',
|
|
'PASSWORD': '',
|
|
'PORT': '',
|
|
'USER': ''
|
|
}
|
|
}
|
|
|
|
THUMBNAIL_PROCESSORS = (
|
|
'easy_thumbnails.processors.colorspace',
|
|
'easy_thumbnails.processors.autocrop',
|
|
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
|
|
'easy_thumbnails.processors.filters'
|
|
)
|
|
|
|
DJANGOCMS_PICTURE_RESPONSIVE_IMAGES = True
|
|
DJANGOCMS_PICTURE_RESPONSIVE_IMAGES_VIEWPORT_BREAKPOINTS = [300, 400, 576, 768]
|