Skip to content

Instantly share code, notes, and snippets.

@ccll
Forked from andreagrandi/settings.py
Created October 28, 2022 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccll/7abe12588e5c10fd8bc6cb9a583b81cb to your computer and use it in GitHub Desktop.
Save ccll/7abe12588e5c10fd8bc6cb9a583b81cb to your computer and use it in GitHub Desktop.
Sending emails from Django during development without using a real SMTP server. Python comes with a very basic and integrated SMTP server. To start it just open a terminal and type: python -m smtpd -n -c DebuggingServer localhost:1025 Then configure your settings.py using the following parameters. You will see the email directly in the terminal …
if DEBUG:
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = 'testing@example.com'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment