Skip to content

Commit

Permalink
[setup] Log emails to console in default dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Dec 17, 2017
1 parent e65be34 commit 6f5d69b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
10 changes: 1 addition & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,11 @@ Create database:
./manage.py migrate
./manage.py createsuperuser
Set ``EMAIL_PORT`` in ``settings.py`` to a port number (eg: ``1025``):

.. code-block:: python
EMAIL_PORT = '1025'
Launch development server and SMTP debugging server:
Launch development server:

.. code-block:: shell
./manage.py runserver 0.0.0.0:8000
# open another terminal and run
python -m smtpd -n -c DebuggingServer localhost:1025
You can access the admin interface at http://127.0.0.1:8000/admin/.

Expand Down
1 change: 0 additions & 1 deletion tests/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

echo "EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'" > local_settings.py
python3 manage.py migrate
python3 manage.py createsuperuser
python3 manage.py runserver 0.0.0.0:8000
3 changes: 3 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@
LOGIN_REDIRECT_URL = 'admin:index'
ACCOUNT_LOGOUT_REDIRECT_URL = LOGIN_REDIRECT_URL

# during development only
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# local settings must be imported before test runner otherwise they'll be ignored
try:
from local_settings import *
Expand Down

0 comments on commit 6f5d69b

Please sign in to comment.