kopia lustrzana https://github.com/rtts/django-simplecms
More sensible default email addresses
rodzic
bd2d622db9
commit
764f135785
|
@ -1,5 +1,6 @@
|
||||||
import swapper
|
import swapper
|
||||||
from django import forms
|
from django import forms
|
||||||
|
from django.conf import settings
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.core.mail import EmailMessage
|
from django.core.mail import EmailMessage
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
@ -133,8 +134,7 @@ class ContactForm(forms.Form):
|
||||||
return
|
return
|
||||||
|
|
||||||
email = EmailMessage(
|
email = EmailMessage(
|
||||||
to = ['info@' + hostname],
|
to = [settings.DEFAULT_TO_EMAIL],
|
||||||
from_email = 'noreply@' + hostname,
|
|
||||||
body = body,
|
body = body,
|
||||||
subject = _('Contact form at %(hostname)s.') % {'hostname': hostname},
|
subject = _('Contact form at %(hostname)s.') % {'hostname': hostname},
|
||||||
headers = {'Reply-To': self.cleaned_data.get('sender')},
|
headers = {'Reply-To': self.cleaned_data.get('sender')},
|
||||||
|
|
|
@ -9,6 +9,7 @@ except ImportError:
|
||||||
PROJECT_NAME = 'example'
|
PROJECT_NAME = 'example'
|
||||||
KEYFILE = f'/tmp/{PROJECT_NAME}.secret'
|
KEYFILE = f'/tmp/{PROJECT_NAME}.secret'
|
||||||
ADMINS = [('JJ Vens', 'jj@rtts.eu')]
|
ADMINS = [('JJ Vens', 'jj@rtts.eu')]
|
||||||
|
DEFAULT_TO_EMAIL = ADMINS
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
ROOT_URLCONF = 'project.urls'
|
ROOT_URLCONF = 'project.urls'
|
||||||
WSGI_APPLICATION = 'project.wsgi.application'
|
WSGI_APPLICATION = 'project.wsgi.application'
|
||||||
|
|
Ładowanie…
Reference in New Issue