skip to navigation
skip to content

dj-email-url 0.0.2

Use an URL to configure email backend settings in your Django Application.

Latest Version: 0.0.6

This utility is based on dj-database-url by Kenneth Reitz.

It allows to utilize the 12factor inspired environments variable to configure the email backend in a Django application.


Import the package in

import dj_email_url

Fetch your email configuration values. The default option is fetch them from EMAIL_URL environment variable:

email_config = dj_email_url.config()

Other option is parse an arbitrary email URL:

email_config = dj_email_url.parse('smtp://...')

Finally, it is necessary to assign values to settings:

EMAIL_HOST = email_config['EMAIL_HOST']
EMAIL_PORT = email_config['EMAIL_PORT']
EMAIL_USE_TLS = email_config['EMAIL_USE_TLS']

Alternatively, it is possible to use this less explicit shortcut:


Supported backends

Currently, it supports:

  • SMTP backend (smtp and smtps),
  • console backend (console),
  • file backend (file),
  • in-memory backend (memory),
  • and dummy backend (dummy).

The scheme smtps indicates to use TLS connections, that is to set EMAIL_USE_TLS to True.

The file backend is the only one which needs a path. The url path is store in EMAIL_FILE_PATH key.

File Type Py Version Uploaded on Size
dj-email-url-0.0.2.tar.gz (md5, pgp) Source 2014-03-12 2KB
  • Downloads (All Versions):
  • 0 downloads in the last day
  • 0 downloads in the last week
  • 2222 downloads in the last month