diff --git a/requirements.txt b/requirements.txt index 717d53b..093ea76 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ django-bootstrap-datepicker-plus django-crispy-forms django-extensions django-filter +django-mailer django-polymorphic django-tables2 djangorestframework diff --git a/tfjm/settings.py b/tfjm/settings.py index 59ae104..ae7f788 100644 --- a/tfjm/settings.py +++ b/tfjm/settings.py @@ -51,10 +51,11 @@ INSTALLED_APPS = [ 'django.forms', 'bootstrap_datepicker_plus', - 'django_extensions', - 'polymorphic', 'crispy_forms', + 'django_extensions', 'django_tables2', + 'mailer', + 'polymorphic', 'rest_framework', 'rest_framework.authtoken', diff --git a/tfjm/settings_dev.py b/tfjm/settings_dev.py index bf6e856..a52990e 100644 --- a/tfjm/settings_dev.py +++ b/tfjm/settings_dev.py @@ -1,4 +1,5 @@ # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +EMAIL_BACKEND = 'mailer.backend.DbBackend' +MAILER_EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' diff --git a/tfjm/settings_prod.py b/tfjm/settings_prod.py index be0fd79..3d6a742 100644 --- a/tfjm/settings_prod.py +++ b/tfjm/settings_prod.py @@ -9,7 +9,8 @@ ALLOWED_HOSTS = ['inscription.tfjm.org', 'plateforme.tfjm.org'] SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'CHANGE_ME_IN_ENV_SETTINGS') # Emails -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_BACKEND = 'mailer.backend.DbBackend' +MAILER_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_SSL = True EMAIL_HOST = os.getenv("SMTP_HOST") EMAIL_PORT = os.getenv("SMTP_PORT")