From 9c3260d400bc33ddb8c4763184993c8085ee4ce0 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 12 Jan 2018 08:40:15 +0100 Subject: [PATCH] Email debug flag (fixes #3526) --- DEVELOPMENT.rst | 4 ++++ openslides/__main__.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/DEVELOPMENT.rst b/DEVELOPMENT.rst index 9ee326f15..f57301f86 100644 --- a/DEVELOPMENT.rst +++ b/DEVELOPMENT.rst @@ -83,6 +83,10 @@ windows run:: $ python manage.py start --no-browser +When debugging something email related change the email backend to console:: + + $ python manage.py start --debug-email + To start OpenSlides with Daphne and four workers (avoid concurrent write requests or use PostgreSQL, see below) run:: diff --git a/openslides/__main__.py b/openslides/__main__.py index 951fb1123..9be6fdefa 100644 --- a/openslides/__main__.py +++ b/openslides/__main__.py @@ -107,6 +107,10 @@ def get_parser(): '--no-browser', action='store_true', help='Do not launch the default web browser.') + subcommand_start.add_argument( + '--debug-email', + action='store_true', + help='Change the email backend to console output.') subcommand_start.add_argument( '--host', action='store', @@ -188,6 +192,9 @@ def start(args): django.setup() from django.conf import settings + if args.debug_email: + settings.EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + # Migrate database call_command('migrate')