299 lines
9.4 KiB
Python
299 lines
9.4 KiB
Python
|
|
"""
|
||
|
|
Django settings for union_auto project.
|
||
|
|
|
||
|
|
Generated by 'django-admin startproject' using Django 4.2.
|
||
|
|
|
||
|
|
For more information on this file, see
|
||
|
|
https://docs.djangoproject.com/en/4.2/topics/settings/
|
||
|
|
|
||
|
|
For the full list of settings and their values, see
|
||
|
|
https://docs.djangoproject.com/en/4.2/ref/settings/
|
||
|
|
"""
|
||
|
|
|
||
|
|
import os
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||
|
|
|
||
|
|
|
||
|
|
# Quick-start development settings - unsuitable for production
|
||
|
|
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
||
|
|
|
||
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||
|
|
SECRET_KEY = 'django-insecure-yjuv*vbopdqv_*rz=v!5s)@od2w^pz+!ylu4arl6x_@o_cwc43'
|
||
|
|
|
||
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||
|
|
DEBUG = True
|
||
|
|
|
||
|
|
ALLOWED_HOSTS = []
|
||
|
|
|
||
|
|
|
||
|
|
# Application definition
|
||
|
|
|
||
|
|
INSTALLED_APPS = [
|
||
|
|
'core',
|
||
|
|
'django.contrib.admin',
|
||
|
|
'django.contrib.auth',
|
||
|
|
'django.contrib.contenttypes',
|
||
|
|
'django.contrib.sessions',
|
||
|
|
'django.contrib.messages',
|
||
|
|
'django.contrib.staticfiles',
|
||
|
|
|
||
|
|
'adminsortable2',
|
||
|
|
'reversion',
|
||
|
|
'easy_thumbnails',
|
||
|
|
'filer',
|
||
|
|
'django_ckeditor_5',
|
||
|
|
'mailer',
|
||
|
|
'django.contrib.sitemaps',
|
||
|
|
'mail_vanger',
|
||
|
|
]
|
||
|
|
|
||
|
|
MIDDLEWARE = [
|
||
|
|
'removewww.middleware.RemoveWwwMiddleware',
|
||
|
|
'django.middleware.security.SecurityMiddleware',
|
||
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||
|
|
'django.middleware.common.CommonMiddleware',
|
||
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||
|
|
'core.middleware.IpAddressMiddleware',
|
||
|
|
]
|
||
|
|
|
||
|
|
REMOVE_WWW = True
|
||
|
|
|
||
|
|
ROOT_URLCONF = 'union_auto.urls'
|
||
|
|
|
||
|
|
TEMPLATES = [
|
||
|
|
{
|
||
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||
|
|
'DIRS': [],
|
||
|
|
'APP_DIRS': True,
|
||
|
|
'OPTIONS': {
|
||
|
|
'context_processors': [
|
||
|
|
'django.template.context_processors.debug',
|
||
|
|
'django.template.context_processors.request',
|
||
|
|
'django.contrib.auth.context_processors.auth',
|
||
|
|
'django.contrib.messages.context_processors.messages',
|
||
|
|
'core.context_processors.global_context',
|
||
|
|
],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
]
|
||
|
|
|
||
|
|
WSGI_APPLICATION = 'union_auto.wsgi.application'
|
||
|
|
|
||
|
|
|
||
|
|
# Database
|
||
|
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
||
|
|
|
||
|
|
DATABASES = {
|
||
|
|
'default': {
|
||
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
||
|
|
'NAME': BASE_DIR / 'db.sqlite3',
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
# Password validation
|
||
|
|
# https://docs.djangoproject.com/en/4.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/4.2/topics/i18n/
|
||
|
|
|
||
|
|
LANGUAGE_CODE = 'ru'
|
||
|
|
|
||
|
|
TIME_ZONE = 'UTC'
|
||
|
|
|
||
|
|
USE_I18N = True
|
||
|
|
|
||
|
|
USE_TZ = True
|
||
|
|
|
||
|
|
|
||
|
|
# Static files (CSS, JavaScript, Images)
|
||
|
|
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||
|
|
|
||
|
|
STATIC_URL = '/static/'
|
||
|
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||
|
|
STATICFILES_DIRS = [
|
||
|
|
os.path.join(BASE_DIR, 'client', 'dist')
|
||
|
|
]
|
||
|
|
|
||
|
|
MEDIA_URL = '/media/'
|
||
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||
|
|
|
||
|
|
# Default primary key field type
|
||
|
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||
|
|
|
||
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||
|
|
|
||
|
|
customColorPalette = [
|
||
|
|
{
|
||
|
|
'color': 'hsl(4, 90%, 58%)',
|
||
|
|
'label': 'Red'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
'color': 'hsl(340, 82%, 52%)',
|
||
|
|
'label': 'Pink'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
'color': 'hsl(291, 64%, 42%)',
|
||
|
|
'label': 'Purple'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
'color': 'hsl(262, 52%, 47%)',
|
||
|
|
'label': 'Deep Purple'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
'color': 'hsl(231, 48%, 48%)',
|
||
|
|
'label': 'Indigo'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
'color': 'hsl(207, 90%, 54%)',
|
||
|
|
'label': 'Blue'
|
||
|
|
},
|
||
|
|
]
|
||
|
|
|
||
|
|
CKEDITOR_5_CONFIGS = {
|
||
|
|
'default': {
|
||
|
|
'toolbar': ['heading', '|', 'bold', 'italic', 'link',
|
||
|
|
'bulletedList', 'numberedList', 'blockQuote', 'imageUpload', ],
|
||
|
|
|
||
|
|
},
|
||
|
|
'extends': {
|
||
|
|
'blockToolbar': [
|
||
|
|
'paragraph', 'heading1', 'heading2', 'heading3',
|
||
|
|
'|',
|
||
|
|
'bulletedList', 'numberedList',
|
||
|
|
'|',
|
||
|
|
'blockQuote',
|
||
|
|
],
|
||
|
|
'toolbar': ['heading', '|', 'outdent', 'indent', '|', 'bold', 'italic', 'link', 'underline', 'strikethrough',
|
||
|
|
'code','subscript', 'superscript', 'highlight', '|', 'codeBlock', 'sourceEditing', 'insertImage',
|
||
|
|
'bulletedList', 'numberedList', 'todoList', '|', 'blockQuote', 'imageUpload', '|',
|
||
|
|
'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', 'mediaEmbed', 'removeFormat',
|
||
|
|
'insertTable',],
|
||
|
|
'image': {
|
||
|
|
'toolbar': ['imageTextAlternative', '|', 'imageStyle:alignLeft',
|
||
|
|
'imageStyle:alignRight', 'imageStyle:alignCenter', 'imageStyle:side', '|'],
|
||
|
|
'styles': [
|
||
|
|
'full',
|
||
|
|
'side',
|
||
|
|
'alignLeft',
|
||
|
|
'alignRight',
|
||
|
|
'alignCenter',
|
||
|
|
]
|
||
|
|
|
||
|
|
},
|
||
|
|
'table': {
|
||
|
|
'contentToolbar': [ 'tableColumn', 'tableRow', 'mergeTableCells',
|
||
|
|
'tableProperties', 'tableCellProperties' ],
|
||
|
|
'tableProperties': {
|
||
|
|
'borderColors': customColorPalette,
|
||
|
|
'backgroundColors': customColorPalette
|
||
|
|
},
|
||
|
|
'tableCellProperties': {
|
||
|
|
'borderColors': customColorPalette,
|
||
|
|
'backgroundColors': customColorPalette
|
||
|
|
}
|
||
|
|
},
|
||
|
|
'heading' : {
|
||
|
|
'options': [
|
||
|
|
{ 'model': 'paragraph', 'title': 'Paragraph', 'class': 'ck-heading_paragraph' },
|
||
|
|
{ 'model': 'heading1', 'view': 'h1', 'title': 'Heading 1', 'class': 'ck-heading_heading1' },
|
||
|
|
{ 'model': 'heading2', 'view': 'h2', 'title': 'Heading 2', 'class': 'ck-heading_heading2' },
|
||
|
|
{ 'model': 'heading3', 'view': 'h3', 'title': 'Heading 3', 'class': 'ck-heading_heading3' }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
'list': {
|
||
|
|
'properties': {
|
||
|
|
'styles': 'true',
|
||
|
|
'startIndex': 'true',
|
||
|
|
'reversed': 'true',
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
THUMBNAIL_ALIASES = {
|
||
|
|
'': {
|
||
|
|
'article_thumbnail': {'size': (1000, 1000), 'quality': 90, 'crop': 'center'},
|
||
|
|
'review_thumbnail': {'size': (100, 100), 'quality': 90, 'crop': 'center'},
|
||
|
|
'experience_thumbnail': {'size': (100, 100), 'quality': 90, 'crop': 'center'},
|
||
|
|
'banner_thumbnail': {'size': (100, 100), 'quality': 90, 'crop': 'center'},
|
||
|
|
},
|
||
|
|
}
|
||
|
|
|
||
|
|
EMAIL_BACKEND = 'mail_vanger.backends.CustomMailBackend'
|
||
|
|
|
||
|
|
SUBJECT = 'Union Auto'
|
||
|
|
EMAIL_NOTIFICATIONS_ENABLED = True
|
||
|
|
EMAIL_HOST_USER = 'example_host@ex_mail.ru'
|
||
|
|
EMAIL_RECIPIENT = ['example_recipient1@ex_mail.ru']
|
||
|
|
|
||
|
|
TELEGRAM_NOTIFICATIONS_ENABLED = True
|
||
|
|
TELEGRAM_ACCESS_TOKEN = ''
|
||
|
|
TELEGRAM_CHAT_ID_FEEDBACK = ''
|
||
|
|
|
||
|
|
API_IP = ''
|
||
|
|
API_KEY = ''
|
||
|
|
AUCTION_ENDPOINT = ''
|
||
|
|
MACHINERY_ENDPOINT = ''
|
||
|
|
|
||
|
|
RATE_API_KEY = ''
|
||
|
|
|
||
|
|
MAIN_PAGE_JAPAN_BRANDS = ['TOYOTA', 'HONDA', 'MAZDA', 'SUZUKI', 'NISSAN', 'AUDI', 'BMW', 'VOLKSWAGEN', 'MERCEDES BENZ', 'MITSUBISHI',]
|
||
|
|
MAIN_PAGE_KOREA_BRANDS = ['HYUNDAI', 'KIA', 'AUDI', 'BMW', 'MERCEDES BENZ', 'VOLKSWAGEN',]
|
||
|
|
|
||
|
|
MIN_PRICE_COEFF = 0
|
||
|
|
MAX_PRICE_COEFF = 100000
|
||
|
|
|
||
|
|
VK_VIDEO_ENDPOINT = 'https://api.vk.com/method/video.get'
|
||
|
|
|
||
|
|
DOMAIN = 'https://unionauto.org'
|
||
|
|
|
||
|
|
MACHINERY_CATEGORIES = ['автовышки', 'ассенизаторы', 'бетононасосы', 'грузовики',
|
||
|
|
'погрузчики', 'экскаваторы', 'рефрижераторы', 'эвакуаторы',
|
||
|
|
'тракторы', 'краны', 'миксеры',]
|
||
|
|
|
||
|
|
TRUCK_BRANDS = ['21', '4', '8', '2', '1', '3']
|
||
|
|
TRUCK_MODELS = ['9680' , '3189', '2997', '27855', '27658', '27852', '27635', '9678', '28901', '27659', '27344', '6367', '27301', '45524', '9719', '27658', '30578', '28994',
|
||
|
|
'9832', '2234', '27264', '27318', '27761', '2236', '27336', '1328', '27275', '503', '525', '4341',
|
||
|
|
'9856', '755', '754', '34933', '764', '28147', '43430', '28049', '766', '770', '9649', '773',
|
||
|
|
'243', '30618', '7808', '9806', '17588', '1729', '350', '27506', '9805', '298',
|
||
|
|
'113', '190', '194', '193',
|
||
|
|
'371', '373', '456', '27324']
|
||
|
|
TRUCKS = [(21, 9680), (21, 3189), (21, 2997), (21, 27855), (21, 27658),
|
||
|
|
(21, 27852), (21, 27635), (21, 9678), (21, 28901), (21, 27659),
|
||
|
|
(21, 27344), (21, 6367), (21, 27301), (21, 45524), (21, 9719),
|
||
|
|
(21, 27658), (21, 30578), (21, 28994), (4, 9832), (4, 2234),
|
||
|
|
(4, 27264), (4, 27318), (4, 27761), (4, 2236), (4, 27336), (4, 1328),
|
||
|
|
(4, 27275), (4, 503), (4, 525), (4, 4341), (8, 9856), (8, 755), (8, 754),
|
||
|
|
(8, 34933), (8, 764), (8, 28147), (8, 43430), (8, 28049), (8, 766), (8, 770),
|
||
|
|
(8, 9649), (8, 773), (2, 243), (2, 30618), (2, 7808), (2, 9806), (2, 17588),
|
||
|
|
(2, 1729), (2, 350), (2, 27506), (2, 9805), (2, 298),
|
||
|
|
(1, 113), (1, 190), (1, 194), (1, 193),
|
||
|
|
(3, 371), (3, 373), (3, 456), (3, 27324)]
|
||
|
|
|
||
|
|
MIN_YEAR=2010
|
||
|
|
|
||
|
|
from .local_settings import *
|