updated mail

This commit is contained in:
Alexander Karpov 2023-12-07 02:52:24 +03:00
parent cdec1efdef
commit f57472f1f3
3 changed files with 28 additions and 11 deletions

View File

@ -7,6 +7,7 @@ DJANGO_READ_DOT_ENV_FILE=no
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
REDIS_URL=redis://redis:6379/1 REDIS_URL=redis://redis:6379/1
REDIS_CACHE=rediscache://redis:6379/1 REDIS_CACHE=rediscache://redis:6379/1
REDIS_CACHE_URL=redis://redis:6379/1
CELERY_BROKER_URL=redis://redis:6379/0 CELERY_BROKER_URL=redis://redis:6379/0
# Celery # Celery

View File

@ -54,7 +54,15 @@
# CACHES # CACHES
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
CACHES = {"default": env.cache_url("REDIS_CACHE")} CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": env("REDIS_CACHE_URL", default="redis://localhost:6379/1"),
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
}
CACHE_MIDDLEWARE_KEY_PREFIX = "cache_middleware" CACHE_MIDDLEWARE_KEY_PREFIX = "cache_middleware"
CACHE_MIDDLEWARE_SECONDS = 0 CACHE_MIDDLEWARE_SECONDS = 0
CACHE_TTL = 60 * 10 CACHE_TTL = 60 * 10
@ -308,6 +316,17 @@
# EMAIL # EMAIL
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
"""
host: EMAIL_HOST
port: EMAIL_PORT
username: EMAIL_HOST_USER
password: EMAIL_HOST_PASSWORD
use_tls: EMAIL_USE_TLS
use_ssl: EMAIL_USE_SSL
timeout: EMAIL_TIMEOUT
ssl_keyfile: EMAIL_SSL_KEYFILE
ssl_certfile: EMAIL_SSL_CERTFILE
"""
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = env( EMAIL_BACKEND = env(
"DJANGO_EMAIL_BACKEND", "DJANGO_EMAIL_BACKEND",
@ -316,11 +335,11 @@
# https://docs.djangoproject.com/en/dev/ref/settings/#email-timeout # https://docs.djangoproject.com/en/dev/ref/settings/#email-timeout
EMAIL_TIMEOUT = 5 EMAIL_TIMEOUT = 5
EMAIL_HOST_PASSWORD = env( EMAIL_HOST_PASSWORD = env(
"EMAIL_PASSWORD", "EMAIL_HOST_PASSWORD",
default="", default="",
) )
EMAIL_HOST_USER = env( EMAIL_HOST_USER = env(
"EMAIL_USER", "EMAIL_HOST_USER",
default="", default="",
) )
EMAIL_USE_SSL = env( EMAIL_USE_SSL = env(
@ -328,6 +347,11 @@
default=False, default=False,
) )
EMAIL_HOST = env("EMAIL_HOST", default="mailhog")
# https://docs.djangoproject.com/en/dev/ref/settings/#email-port
EMAIL_PORT = env("EMAIL_PORT", default="1025")
EMAIL_FROM = env("EMAIL_FROM", default="noreply@akarpov.ru")
# ADMIN # ADMIN
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Django Admin URL. # Django Admin URL.

View File

@ -15,14 +15,6 @@
ALLOWED_HOSTS = ["*"] ALLOWED_HOSTS = ["*"]
CSRF_TRUSTED_ORIGINS = ["http://127.0.0.1", "https://*.akarpov.ru"] CSRF_TRUSTED_ORIGINS = ["http://127.0.0.1", "https://*.akarpov.ru"]
# 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
EMAIL_PORT = env("EMAIL_PORT", default="1025")
EMAIL_FROM = env("EMAIL_FROM", default="noreply@akarpov.ru")
# WhiteNoise # WhiteNoise
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development # http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development