From 33666035c446ad10ba34e94da864104ad58f259c Mon Sep 17 00:00:00 2001 From: NikDizell Date: Sat, 20 Jun 2026 14:23:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=20se?= =?UTF-8?q?ttings.SITE=5FURL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OneCprogsite/settings.py | 2 ++ programmer/tasks.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OneCprogsite/settings.py b/OneCprogsite/settings.py index ca1b958..a501465 100644 --- a/OneCprogsite/settings.py +++ b/OneCprogsite/settings.py @@ -48,6 +48,8 @@ ALLOWED_HOSTS = os.getenv('DJANGO_ALLOWED_HOSTS', 'localhost,127.0.0.1').split(' # Исключения для отслеживания EXCLUDED_IPS = os.getenv('EXCLUDED_IPS', 'localhost,127.0.0.1').split(',') +SITE_URL = os.getenv('SITE_URL', 'https://nikdizell.ru') + # Важно для работы за прокси if not DEBUG: SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') diff --git a/programmer/tasks.py b/programmer/tasks.py index b9e5cc9..f3f2d79 100644 --- a/programmer/tasks.py +++ b/programmer/tasks.py @@ -86,7 +86,7 @@ def send_new_article_notification(article_id): subject = f'📰 Новая статья: {article.title}' context = { 'article': article, - 'site_url': settings.ALLOWED_HOSTS[0] if settings.ALLOWED_HOSTS else 'localhost', + 'site_url': settings.SITE_URL, 'site_name': 'С.Н.А. Технологии', } html_message = render_to_string('emails/new_article_notification.html', context) @@ -128,7 +128,7 @@ def send_new_product_notification(product_id): subject = f'🛒 Новый продукт: {product.title}' context = { 'product': product, - 'site_url': settings.ALLOWED_HOSTS[0] if settings.ALLOWED_HOSTS else 'localhost', + 'site_url': settings.SITE_URL, 'site_name': 'С.Н.А. Технологии', } html_message = render_to_string('emails/new_product_notification.html', context)