File: //proc/682/cwd/project/settings.py.orig
from datetime import datetime
from pathlib import Path
from django.conf.urls.static import static
from django.utils.translation import gettext_lazy as _
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-&wx)#7*)+osj5v(0n2_^9&1@lz3@9)0l%dsnn=&%&3cb3s2c8$'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
CDN_USE = False
SITE_ID = 1
DEMO = False
ALLOWED_HOSTS = [
'127.0.0.1',
'localhost',
'82.148.16.210',
'sarafai.com',
'www.sarafai.com',
]
INTERNAL_IPS = [
"127.0.0.1",
]
# django-cors
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOWED_ORIGINS = [
'http://127.0.0.1:8000',
'http://localhost:8080',
'http://82.148.16.210',
'https://82.148.16.210',
'https://sarafai.com',
'https://www.sarafai.com',
'http://sarafai.com',
'http://www.sarafai.com',
]
CORS_ORIGIN_WHITELIST = [
"http://localhost:8000",
"http://127.0.0.1:8000",
]
CSRF_TRUSTED_ORIGINS = CORS_ALLOWED_ORIGINS
INSTALLED_APPS = [
'apps.dashboard.apps.DashboardConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.humanize',
'rest_framework',
'corsheaders',
'debug_toolbar',
'django_extensions',
# MERGE
# # Project apps
'apps.shop.apps.ShopConfig',
'apps.cart.apps.CartConfig',
'apps.orders.apps.OrdersConfig',
# 'paypal',
# 'paypal.standard.ipn',
# 'apps.payment.apps.PaymentConfig',
'apps.cupons.apps.CuponsConfig',
# 'apps.pages_articles',
'apps.homepage.apps.HomepageConfig',
'apps.pages.apps.PagesConfig',
'apps.core.apps.CoreConfig',
'apps.feedback.apps.FeedbackConfig',
'apps.api.apps.ApiConfig',
#
# # Third-party apps
# # 'redactor',
# # 'easy_thumbnails',
'ckeditor',
'ckeditor_uploader',
# # 'mptt',
# # 'filer',
# 'ckeditor_filebrowser_filer',
'macros',
'phonenumber_field',
'packages.static_sitemaps',
'rosetta',
'crispy_forms',
'crispy_bootstrap5',
'imagekit',
'packages.snowpenguin.django.recaptcha3',
]
MIDDLEWARE = [
# django-debug-toolbar
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
# django-cors-headers
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# django-htmlmin
'htmlmin.middleware.HtmlMinifyMiddleware',
'htmlmin.middleware.MarkRequestMiddleware',
# 'core.middleware.CurrentUserMiddleware'
]
ROOT_URLCONF = 'project.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],
'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',
# MERGE
'apps.cart.context_processors.cart',
'apps.core.context_processors.debug',
'apps.core.context_processors.demo',
'apps.core.context_processors.project',
# Context processor for static/media files
'django.template.context_processors.media',
],
# MERGE
'libraries': {
'shuffle': 'apps.core.templatetags.shuffle'
}
},
},
]
WSGI_APPLICATION = 'project.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
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',
},
]
LANGUAGE_CODE = 'ru-ru'
LANGUAGES = [
('ru', _('Russian')),
('en', _('English')),
]
LOCALE_PATHS = [
BASE_DIR / 'apps/',
]
TIME_ZONE = 'Europe/Moscow'
USE_I18N = True
USE_L10N = True
USE_TZ = True
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S"
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / 'static'
STATICFILES_DIRS = (
BASE_DIR / 'static_files/',
BASE_DIR / 'media/',
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# 2021.11.12
# info@sarafai.com
# yE4hF8cV3vM9aD7q
# django-htmlmin
HTML_MINIFY = True
EXCLUDE_FROM_MINIFYING = ('^admin_sarafai/',)
KEEP_COMMENTS_ON_MINIFYING = False
# MERGE 2021.11.17
# django-recaptcha3
RECAPTCHA_PRIVATE_KEY = '6LdEgjceAAAAAMsRlTMIKKUZNp5iyBGMjdtW6LBB'
RECAPTCHA_PUBLIC_KEY = '6LdEgjceAAAAAFFfQJCwV26CjH3RIFPwZ0RKwBdW'
RECAPTCHA_DEFAULT_ACTION = 'generic'
RECAPTCHA_SCORE_THRESHOLD = 0.5
# RECAPTCHA_LANGUAGE = 'en' # for auto detection language, remove this from your settings
# If you require reCaptcha to be loaded from somewhere other than https://google.com
# (e.g. to bypass firewall restrictions), you can specify what proxy to use.
# RECAPTCHA_FRONTEND_PROXY_HOST = 'https://recaptcha.net'
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
SESSION_COOKIE_HTTPONLY = True
# Session ID
CART_SESSION_ID = 'sarafai_cart'
# Email
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
ADMINS = [
('Mikhail', '891rpm@gmail.com'),
]
MANAGERS = ADMINS
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_HOST_USER = 'robot@sarafai.com'
EMAIL_HOST_PASSWORD = 'ynf9nVwVLXS6TFpZ'
EMAIL_MODE = 'SSL'
if EMAIL_MODE == 'TLS':
# TLS
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
elif EMAIL_MODE == 'SSL':
# SSL
EMAIL_PORT = 465
EMAIL_USE_TLS = False
EMAIL_USE_SSL = True
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER
MAIL_SUBJECT = 'Запрос обратного звонка с сайта SARAFAI.COM'
MAIL_MESSAGE = 'Поступил запрос на обратный звонок с сайта:<br><br>' \
'Телефон: <h3>%s</h3><br><br>' \
'--<br>' \
'<b>sarafai.com</b>' % '1293761823'
MAIL_FROM_EMAIL = 'sarafai robot <robot@sarafai.com>'
if DEBUG:
MAIL_TO_EMAIL = '891rpm@gmail.com'
else:
MAIL_TO_EMAIL = '891rpm@gmail.com', 'shop@sarafai.com'
MAIL_REPLY_TO = 'shop@sarafai.com'
MAIL_HEADERS = {'Reply-To': MAIL_REPLY_TO}
MAIL_CONTENT = 'html'
MAIL_BACKEND = 'EmailMessage'
# Celery 5
# # broker_url = 'amqp://localhost'
# broker_url = 'pyamqp://'
# result_backend = 'rpc://'
# result_persistent = False
# # accept_content = ['application/json']
# accept_content = ['json']
# task_serializer = 'json'
# result_serializer = 'json'
# timezone = 'Europe/Moscow'
# enable_utc = True
CELERY_TIMEZONE = "Europe/Moscow"
CELERY_TASK_TRACK_STARTED = True
CELERY_TASK_TIME_LIMIT = 30 * 60
CELERY_TASK_REPETITION = 5 * 60
# celery -A project worker -l info
# RabbitMQ
# 0. Install RabbitMQ
# sudo apt install rabbitmq-server
# 1. Enable Web management plugin
# sudo rabbitmq-plugins enable rabbitmq_management
# 2. Add user
# sudo rabbitmqctl add_user USER PASSWORD
# 3. User permissions
# sudo rabbitmqctl set_permissions -p / username ".*" ".*" ".*"
# sudo rabbitmqctl set_user_tags username administrator
# Work
# sudo systemctl status rabbitmq-server
# Paypal
# PAYPAL_RECEIVER_EMAIL = 'dikiigr-facilitator-1@gmail.com'
PAYPAL_RECEIVER_EMAIL = 'zottau@gmail.com'
PAYPAL_TEST = True
# django-ckeditor
CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'
CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_ALLOW_NONIMAGE_FILES = False
CKEDITOR_UPLOAD_SLUGIFY_FILENAME = False
CKEDITOR_RESTRICT_BY_USER = True
CKEDITOR_BROWSE_SHOW_DIRS = True
CKEDITOR_CONFIGS = {
'default': {
'toolbar': (
['div', 'Source', '-', 'Save', 'NewPage', 'Preview', '-', 'Templates'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Print', 'SpellChecker', 'Scayt'],
['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'],
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Link', 'Unlink', 'Anchor'],
['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'],
['Styles', 'Format', 'Font', 'FontSize'],
['TextColor', 'BGColor'],
['Maximize', 'ShowBlocks', '-', 'About', 'pbckcode', '-'],
# ['FilerImage'],
),
# 'extraPlugins': 'filerimage',
# 'removePlugins': 'image'
},
}
"""
# config django-ckeditor-filebrowser-filer
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'Custom',
'toolbar_Custom': [
...
['FilerImage']
],
'extraPlugins': 'filerimage',
'removePlugins': 'image'
},
}
# config ckeditor
CKEDITOR_CONFIGS = {
'default': {
'toolbar': (
['div', 'Source', '-', 'Save', 'NewPage', 'Preview', '-', 'Templates'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Print', 'SpellChecker', 'Scayt'],
['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'],
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Link', 'Unlink', 'Anchor'],
['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'],
['Styles', 'Format', 'Font', 'FontSize'],
['TextColor', 'BGColor'],
['Maximize', 'ShowBlocks', '-', 'About', 'pbckcode'],
),
}
}
"""
# django-static-sitemaps
STATICSITEMAPS_ROOT_SITEMAP = 'project.sitemaps.sitemaps'
STATICSITEMAPS_USE_GZIP = True
# STATICSITEMAPS_GZIP_METHOD = ['python', 'system']
STATICSITEMAPS_SYSTEM_GZIP_PATH = BASE_DIR / 'sitemaps'
# STATICSITEMAPS_URL = '/static'
STATICSITEMAPS_URL = 'https://sarafai.com/static'
# cron task
# django-admin.py refresh_sitemap
# easy_thumbnails
THUMBNAIL_ALIASES = {
'': {
# 'thumbnail-avatar': {'size': (100, 100), 'crop': True},
# # 'thumbnail-xs': {'size': (50, 50), 'crop': True},
# # 'thumbnail-m': {'size': (100, 100), 'crop': True},
# 'thumbnail-l': {'size': (150, 0), 'crop': True},
# 'thumbnail-xl': {'size': (200, 0), 'crop': 'smart', 'autocrop': True, 'upscale': True},
# 'thumbnail-xxl': {'size': (400, 0), 'crop': True},
# 'thumbnail-xxxl': {'size': (800, 0), 'crop': True},
# 'thumbnail-xxxxl': {'size': (1024, 0), 'crop': True},
'thumbnail': {'size': (100, 200), 'crop': True},
'image': {'size': (1080, 1920), 'crop': True},
},
}
THUMBNAIL_BASEDIR = ''
THUMBNAIL_CACHE_DIMENSIONS = False
THUMBNAIL_CHECK_CACHE_MISS = False
THUMBNAIL_DEBUG = True
THUMBNAIL_DEFAULT_OPTIONS = None # {'bw': True}
THUMBNAIL_DEFAULT_STORAGE = 'easy_thumbnails.storage.ThumbnailFileSystemStorage'
THUMBNAIL_EXTENSION = 'png'
THUMBNAIL_HIGHRES_INFIX = '@2x'
THUMBNAIL_HIGH_RESOLUTION = True
THUMBNAIL_MEDIA_ROOT = ''
THUMBNAIL_MEDIA_URL = ''
THUMBNAIL_NAMER = 'easy_thumbnails.namers.hashed' # default / hashed / source_hashed / hashed
THUMBNAIL_PREFIX = ''
THUMBNAIL_PRESERVE_EXTENSIONS = None # ('png',)
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
# 'easy_thumbnails.processors.scale_and_crop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
'easy_thumbnails.processors.background',
)
THUMBNAIL_PROGRESSIVE = 100
THUMBNAIL_QUALITY = 85
THUMBNAIL_SOURCE_GENERATORS = ('easy_thumbnails.source_generators.pil_image',)
THUMBNAIL_SUBDIR = ''
THUMBNAIL_TRANSPARENCY_EXTENSION = 'png'
# django-phonenumber-field
PHONENUMBER_DB_FORMAT = 'INTERNATIONAL' # 'E164', 'INTERNATIONAL', 'RFC3966'
# PHONENUMBER_DEFAULT_REGION = 'Russia'
# # Sentry
# import sentry_sdk
# from sentry_sdk.integrations.django import DjangoIntegration
#
# sentry_sdk.init(
# dsn="https://c61a79f5e5784e52a42df2626bde5a8e@o166389.ingest.sentry.io/6080048",
# integrations=[DjangoIntegration()],
#
# # Set traces_sample_rate to 1.0 to capture 100%
# # of transactions for performance monitoring.
# # We recommend adjusting this value in production.
# traces_sample_rate=1.0,
#
# # If you wish to associate users to errors (assuming you are using
# # django.contrib.auth) you may enable sending PII data.
# send_default_pii=True
# )
# django-user-accounts
LOGIN_REDIRECT_URL = 'dashboard_view'
LOGOUT_REDIRECT_URL = "homepage_view"
# crispy-bootstrap5
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_TEMPLATE_PACK = "bootstrap5"
# django-rest-framework
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
],
# 'DEFAULT_PERMISSION_CLASSES': (
# 'rest_framework.permissions.IsAdminUser',
# ),
# 'DEFAULT_RENDERER_CLASSES': (
# 'rest_framework.renderers.JSONRenderer',
# #'rest_framework.renderers.BrowsableAPIRenderer',
# ),
'PAGINATE_BY': 10,
'PAGINATE_BY_PARAM': 'page_size',
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10,
}
# FIX. Create directory ../logs for LOGGING feature
Path('../logs/').mkdir(parents=True, exist_ok=True)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'console': {
'format': '%(name)-12s %(levelname)-8s %(message)s'
},
'file': {
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'console',
},
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'formatter': 'file',
'filename': '../logs/debug.log'
}
},
'root': {
'handlers': ['console', 'file'],
'level': 'DEBUG',
},
}
# SARAFAI.COM settings
PROJECT_SETTINGS = {
'client': {
'email_style': 'html'
},
'project': {
'name': 'сарафай',
'name_2': 'Сарафай',
'url': 'https://sarafai.com',
'url_short': 'sarafai.com',
'description': '',
'keywords': '',
'slogan': 'одежда от производителя',
# 'phone': '+7 926 079-01-07',
# 'phone_short': '+79260790107',
# 'phone_work_time': 'Пн-Вс, 10-19',
# 'phone_work_time_stat': '10',
# 'phone_work_time_end': '19',
'email': 'shop@sarafai.com', # Deprecated
'email_manager': 'robot@sarafai.com', # Deprecated
'email_notification': MAIL_TO_EMAIL, # Deprecated
'email_icon': 'fa fa-envelope-o',
'email_subject_prefix': 'SARAFAI.COM',
'logo_small': 'images/logo.png',
'logo_large': 'images/logo_large.png',
'datetime_format': '%Y-%m-%d %H:%M:%S',
'contacts': {
'email': 'shop@sarafai.com',
'email_manager': 'robot@sarafai.com',
'email_notification': MAIL_TO_EMAIL,
'link_facebook': 'http://facebook.com/',
'link_instagram': 'http://instagram.com/',
},
# 'map_code': '<script type="text/javascript" charset="utf-8" async src="https://api-maps.yandex.ru/services/constructor/1.0/js/?um=constructor%3Abdb18e891f69800bd88c1d1a7c9caf7e73a79e3b5debf048d1357b6c1253bd0f&width=100%25&height=450&lang=ru_RU&scroll=false"></script>',
# 'address': {
# 'country': 'Российская Федерация',
# 'region': 'Московская область, Люберецкий район',
# 'location': 'д. Марусино',
# 'street': 'Новомарусинский проезд',
# 'office': 'д. 1',
# 'postal_code': '140009',
# 'warehouse': 'Московская область, Люберецкий район, д. Марусино, Новомарусинский проезд, д. 1, офис 1 (1-й этаж)',
# 'legal': '140009, Российская Федерация, Московская область, Люберецкий район, д. Марусино, Новомарусинский проезд, д. 1',
# },
# 'requisites': {
# 'line_0': 'ИП Михайлов Рамиль Равильевич',
# 'line_1': 'ИНН: 503302637229',
# 'line_2': 'КПП: 123456789',
# 'line_3': 'ОГРН: 313501222400049',
# 'line_4': 'Расчетный счет: 4080 2810 3000 0004 2250',
# 'line_5': 'Банк: ПАО "ПРОМСВЯЗЬБАНК"',
# 'line_6': 'Банковские реквизиты: БИК 044525555',
# 'line_7': 'Корреспондентский счет: 30101810400000000555',
# 'line_8': 'ОКПО: 40148343',
# 'line_9': 'SWIFT: PRMSRUMMXXX',
# },
'copyright': f"© 2021-{datetime.now().strftime('%Y')}. Сарафай. Все права защищены.",
'msvalidate_01': '',
'google_site_verification': '0ItdOZQ862Z7L0wIrqwHhUnSGWOYYX6fMcDhF2RWnjQ',
'yandex_verification': 'c1246c226830043c',
'recaptcha': RECAPTCHA_PUBLIC_KEY,
'cdn': CDN_USE,
'debug': DEBUG,
'show_header': False,
# Shop Settings
'payment': {
# 'type_1': {
# 'name': 'Оплата наличными',
# 'slug': 'cash',
# 'description': 'Оплата наличными производится: <ul class="uk-list uk-list-bullet">'
# '<li>курьеру при получении заказа,</li>'
# '<li>в почтовом отделении при получении посылки</li>'
# '<li>или при самовывозе из нашего магазина.</li>'
# '</ul>',
# 'status': 'disabled',
# 'visibility': 'false',
# },
'type_2': {
'name': 'Оплата банковской картой',
'slug': 'card',
'description': 'Процесс оплаты начнется после указания вами данных для доставки и подтверждения заказа.',
'status': 'enabled',
'visibility': 'true',
'image': '<div class="ps-5 mb-4"><img alt="" class="p-2" src="/static/img/payment/mastercard_logo.svg" style="width: 4rem;"><img alt="" class="p-2" src="/static/img/payment/visa_logo.svg" style="width: 4rem;"><img alt="" class="p-2" src="/static/img/payment/mir_logo.svg" style="width: 4rem;"></div>'
},
# 'type_3': {
# 'name': 'Квитанция Сбербанка (банковский перевод для физических лиц)',
# 'slug': 'sberbank_pd4',
# 'description': '<span class="text-warning">Оплата с помощью квитанции Сбербанка '
# 'временно недоступна.<br>Приносим свои извинения.</span>',
# 'status': 'disabled',
# 'visibility': 'false',
# },
# 'type_4': {
# 'name': 'Безналичный расчет (банковский перевод для юридических лиц)',
# 'slug': 'requisites',
# 'status': 'disabled',
# 'visibility': 'false',
# },
# 'type_5': {
# 'name': 'Платежная система PayPal (только для физических лиц)',
# 'slug': 'paypal',
#
# 'status': 'disabled',
# 'visibility': 'false',
# },
# 'type_6': {
# 'name': 'Оплата банковской картой',
# 'slug': 'card',
# 'description': '<span class="text-warning">Оплата заказа банковской картой временно недоступна.<br>'
# 'Приносим свои извинения.</span>',
# 'status': 'disabled',
# 'visibility': 'false',
# },
# 'type_7': {
# 'name': 'Оплата <Метод #7>',
# 'slug': 'payment_method_7',
# 'description': '',
# 'status': 'disabled',
# 'visibility': 'false',
# },
# 'type_8': {
# 'name': 'Оплата <Метод #8>',
# 'slug': 'payment_method_8',
# 'description': '',
# 'status': 'disabled',
# 'visibility': 'false',
# },
},
'delivery': {
# ('courier_service_dpd', 'Курьерская служба DPD'),
# ('courier_service_cdek', 'Курьерская служба СДЭК'),
# ('courier_service_boxberry', 'Курьерская служба BoxBerry'),
'type_1': {
'name': 'Курьер магазина',
'slug': 'courier',
'cost': '300', # RUB
'cost_moscow_in': '0', # RUB
'cost_moscow_out': '300', # RUB
'cost_moscow_out_km': '50', # RUB
'cost_region_min': '300',
'cost_region_km': '50', # RUB
'region': 'Заказы доставляются по Москве и Московской области',
'conditions': 'Курьер доставляет товар с 10:00-20:00, по рабочим дням и в субботу - Пн-Сб',
'status': 'disabled',
'visibility': 'false',
'position': 4,
'image': ''
},
'type_2': {
'name': 'Почта России',
'slug': 'russian_post',
'link': 'pochta.ru',
'cost': '0',
'status': 'enabled',
'visibility': 'true',
'position': 1,
'image': '<img id="delivery_image" src="/static/img/delivery/pochta_logo.svg" style="width:100px; height:48px;" alt="">'
},
'type_3': {
'name': 'Самовывоз со склада магазина',
'slug': 'customer_pickup',
'cost': '0',
'status': 'disabled',
'visibility': 'false',
'position': 3,
'image': ''
},
'type_4': {
'name': 'СДЭК',
'slug': 'cdek',
'link': 'cdek.ru',
'cost': '0',
'status': 'disabled',
'visibility': 'true',
'position': 2,
'image': ''
},
'type_5': {
'name': 'Достависта',
'slug': 'dostavista',
'link': 'dostavista.ru',
'cost': '0',
'status': 'disabled',
'visibility': 'true',
'position': 5,
'image': ''
},
},
'minimum_delivery_cost': '300', # RUB
'minimum_order_price': '0', # RUB
'minimum_qty': '1', # items
}
}
# SMS.RU provider
SMSRU_API_TOKEN = 'ab7d585e-edaa-2914-1902-8b06317ff73f'
SMSRU_URL = 'https://sms.ru/sms/send'
SMSRU_FROM_LABEL = 'sarafai'
# SMSRU_URL_W_PARAMS = f'https://sms.ru/sms/send?api_id={SMSRU_API}&to={TO}&msg={message}&json=1'
TO_MANAGER_PHONE = '79057717277'
# TO_MANAGER_PHONE = '79057717277,79680148842'
# Work with Celery and RabbitMQ
# 1. sudo systemctl status rabbitmq-server
#
# 2. celery -A project worker -l debug
# 2. [PROD] celery -A project worker -l info
#
# 3. celery -A project flower --address=127.0.0.1 --port=5566
#
# TINKOFF_TERMINAL_KEY = '1643719737320'
# TINKOFF_TERMINAL_PASSWORD = 's9jg22ax0t37dpeq'
TINKOFF_TERMINAL_KEY = '1643719737320DEMO'
TINKOFF_TERMINAL_PASSWORD = 'c5nh6y1wic3v3o4n'
TINKOFF_PROCESSING_RESPONCE_URL = 'https://sarafai.com/api/processing/'
# Project errors solutions
# ERROR: OSError: cannot load library 'pango-1.0-0': pango-1.0-0: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0-0'
# SOLUTION: apt install libpangocairo-1.0-0