Заменил settings.SITE_URL

This commit is contained in:
NikDizell 2026-06-20 14:23:26 +03:00
parent 99140bf8ca
commit 33666035c4
2 changed files with 4 additions and 2 deletions

View File

@ -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')

View File

@ -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)