]> git.parisson.com Git - teleforma.git/commitdiff
fix DEBUG mode and email backend
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 6 Dec 2023 10:49:34 +0000 (11:49 +0100)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 6 Dec 2023 10:49:34 +0000 (11:49 +0100)
app/settings.py

index 3252c2553db115d0e5a62bc2642bb7a6f7029dbb..fc55e496fbc1d308b0001dce390b8e7c6f6ece91 100644 (file)
@@ -11,7 +11,8 @@ from django.urls import reverse_lazy
 
 sys.dont_write_bytecode = True
 
-DEBUG = True
+DEBUG = True if os.environ.get('DEBUG') == 'True' else False
+
 TEMPLATE_DEBUG = DEBUG
 
 DEBUG_TOOLBAR = False
@@ -257,6 +258,8 @@ SERVER_EMAIL = 'crfpa@pre-barreau.com'
 EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION + '] '
 if DEBUG:
     EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
+else:
+    EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
 
 POSTMAN_AUTO_MODERATE_AS = True
 POSTMAN_DISALLOW_ANONYMOUS = True