2022-11-23 11:41:43 +03:00
|
|
|
from .base import * # noqa
|
|
|
|
from .base import env
|
|
|
|
|
|
|
|
# GENERAL
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
|
|
|
|
DEBUG = True
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
|
|
|
SECRET_KEY = env(
|
|
|
|
"DJANGO_SECRET_KEY",
|
|
|
|
default="Lm4alUqtub6qQT4MnV4NmtXQP02RCBtmGj1bJhyDho07Bkjk9WFZxGtwpnLNQGJQ",
|
|
|
|
)
|
2023-09-24 20:28:21 +03:00
|
|
|
TOKEN_EXP = 24 * 60 * 60
|
2022-11-23 11:41:43 +03:00
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
2023-04-13 00:54:44 +03:00
|
|
|
ALLOWED_HOSTS = ["*"]
|
|
|
|
CSRF_TRUSTED_ORIGINS = ["http://127.0.0.1", "https://*.akarpov.ru"]
|
2022-11-23 11:41:43 +03:00
|
|
|
|
|
|
|
# EMAIL
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-host
|
|
|
|
EMAIL_HOST = env("EMAIL_HOST", default="mailhog")
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-port
|
2023-04-07 22:46:37 +03:00
|
|
|
EMAIL_PORT = env("EMAIL_PORT", default="1025")
|
2023-09-24 20:28:21 +03:00
|
|
|
EMAIL_FROM = env("EMAIL_FROM", default="noreply@akarpov.ru")
|
2022-11-23 11:41:43 +03:00
|
|
|
|
|
|
|
# WhiteNoise
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development
|
|
|
|
INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405
|
|
|
|
|
|
|
|
|
|
|
|
# django-debug-toolbar
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
|
|
|
|
INSTALLED_APPS += ["debug_toolbar"] # noqa F405
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware
|
|
|
|
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
"DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
|
|
|
|
"SHOW_TEMPLATE_CONTEXT": True,
|
|
|
|
}
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
|
|
|
|
INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
|
|
|
|
if env("USE_DOCKER") == "yes":
|
|
|
|
import socket
|
|
|
|
|
|
|
|
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
|
|
|
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
|
|
|
|
|
|
|
|
# django-extensions
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration
|
|
|
|
INSTALLED_APPS += ["django_extensions"] # noqa F405
|
|
|
|
# Celery
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-eager-propagates
|
|
|
|
CELERY_TASK_EAGER_PROPAGATES = True
|
2023-08-10 17:25:10 +03:00
|
|
|
|
|
|
|
|
|
|
|
# SHORTENER
|
2022-11-23 11:41:43 +03:00
|
|
|
# ------------------------------------------------------------------------------
|
2023-08-10 17:25:10 +03:00
|
|
|
SHORTENER_REDIRECT_TO = "http://127.0.0.1:8000"
|
|
|
|
SHORTENER_HOST = "http://127.0.0.1:3000"
|