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')