Заменил settings.SITE_URL
This commit is contained in:
parent
99140bf8ca
commit
33666035c4
@ -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(',')
|
EXCLUDED_IPS = os.getenv('EXCLUDED_IPS', 'localhost,127.0.0.1').split(',')
|
||||||
|
|
||||||
|
SITE_URL = os.getenv('SITE_URL', 'https://nikdizell.ru')
|
||||||
|
|
||||||
# Важно для работы за прокси
|
# Важно для работы за прокси
|
||||||
if not DEBUG:
|
if not DEBUG:
|
||||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
|
|||||||
@ -86,7 +86,7 @@ def send_new_article_notification(article_id):
|
|||||||
subject = f'📰 Новая статья: {article.title}'
|
subject = f'📰 Новая статья: {article.title}'
|
||||||
context = {
|
context = {
|
||||||
'article': article,
|
'article': article,
|
||||||
'site_url': settings.ALLOWED_HOSTS[0] if settings.ALLOWED_HOSTS else 'localhost',
|
'site_url': settings.SITE_URL,
|
||||||
'site_name': 'С.Н.А. Технологии',
|
'site_name': 'С.Н.А. Технологии',
|
||||||
}
|
}
|
||||||
html_message = render_to_string('emails/new_article_notification.html', context)
|
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}'
|
subject = f'🛒 Новый продукт: {product.title}'
|
||||||
context = {
|
context = {
|
||||||
'product': product,
|
'product': product,
|
||||||
'site_url': settings.ALLOWED_HOSTS[0] if settings.ALLOWED_HOSTS else 'localhost',
|
'site_url': settings.SITE_URL,
|
||||||
'site_name': 'С.Н.А. Технологии',
|
'site_name': 'С.Н.А. Технологии',
|
||||||
}
|
}
|
||||||
html_message = render_to_string('emails/new_product_notification.html', context)
|
html_message = render_to_string('emails/new_product_notification.html', context)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user