diff options
| author | José Padilla <jpadilla@webapplicate.com> | 2014-09-12 22:46:22 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-09-13 09:33:21 -0400 |
| commit | 5472d18e3193050f5b9a25b71852ca7b77f852a5 (patch) | |
| tree | b65e10a3ab0c5ee90fe0a5989050cbb21672c437 /docs | |
| parent | 0ae79014c09f4ddd2575f53371d994773d0bd43c (diff) | |
Fixed #23461 -- Added EMAIL_TIMEOUT setting
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/settings.txt | 13 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 3 | ||||
| -rw-r--r-- | docs/topics/email.txt | 36 |
3 files changed, 27 insertions, 25 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 507f3f11c9..c1d094b629 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1266,6 +1266,18 @@ connection. Please refer to the documentation of Python's :func:`python:ssl.wrap_socket` function for details on how the certificate chain file and private key file are handled. +.. setting:: EMAIL_TIMEOUT + +EMAIL_TIMEOUT +------------- + +.. versionadded:: 1.8 + +Default: ``None`` + +Specifies a timeout in seconds for blocking operations like the connection +attempt. + .. setting:: FILE_CHARSET FILE_CHARSET @@ -3089,6 +3101,7 @@ Email * :setting:`EMAIL_SSL_CERTFILE` * :setting:`EMAIL_SSL_KEYFILE` * :setting:`EMAIL_SUBJECT_PREFIX` +* :setting*`EMAIL_TIMEOUT` * :setting:`EMAIL_USE_TLS` * :setting:`MANAGERS` * :setting:`SERVER_EMAIL` diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 41d029a9ca..a904f0fd13 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -154,6 +154,9 @@ Email authentication with the :setting:`EMAIL_SSL_CERTFILE` and :setting:`EMAIL_SSL_KEYFILE` settings. +* The SMTP :class:`~django.core.mail.backends.smtp.EmailBackend` now supports + setting the ``timeout`` parameter with the :setting:`EMAIL_TIMEOUT` setting. + File Storage ^^^^^^^^^^^^ diff --git a/docs/topics/email.txt b/docs/topics/email.txt index a7a9329974..7303a6fe6f 100644 --- a/docs/topics/email.txt +++ b/docs/topics/email.txt @@ -451,41 +451,27 @@ SMTP backend The server address and authentication credentials are set in the :setting:`EMAIL_HOST`, :setting:`EMAIL_PORT`, :setting:`EMAIL_HOST_USER`, :setting:`EMAIL_HOST_PASSWORD`, :setting:`EMAIL_USE_TLS`, - :setting:`EMAIL_USE_SSL`, :setting:`EMAIL_SSL_CERTFILE` and - :setting:`EMAIL_SSL_KEYFILE` settings in your settings file. + :setting:`EMAIL_USE_SSL`, :setting:`EMAIL_TIMEOUT`, + :setting:`EMAIL_SSL_CERTFILE` and :setting:`EMAIL_SSL_KEYFILE` settings + in your settings file. The SMTP backend is the default configuration inherited by Django. If you want to specify it explicitly, put the following in your settings:: EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' - Here is an attribute which doesn't have a corresponding setting like the - others described above: + .. versionadded:: 1.7 - .. attribute:: timeout - - .. versionadded:: 1.7 - - This backend contains a ``timeout`` parameter, which can be set with - the following sample code:: - - from django.core.mail.backends import smtp - - class MyEmailBackend(smtp.EmailBackend): - def __init__(self, *args, **kwargs): - kwargs.setdefault('timeout', 42) - super(MyEmailBackend, self).__init__(*args, **kwargs) - - Then point the :setting:`EMAIL_BACKEND` setting at your custom backend as - described above. - - If unspecified, the default ``timeout`` will be the one provided by - :func:`socket.getdefaulttimeout()`, which defaults to ``None`` (no timeout). + The ``timeout`` parameter was added. If unspecified, the default + ``timeout`` will be the one provided by + :func:`socket.getdefaulttimeout()`, which defaults to ``None`` (no + timeout). .. versionchanged:: 1.8 - The ``ssl_keyfile`` and ``ssl_certfile`` parameters and - corresponding settings were added. + The ``ssl_keyfile``, and ``ssl_certfile`` parameters and corresponding + settings were added. The ability to customize ``timeout`` using + a setting (:setting:`EMAIL_TIMEOUT`) was added. .. _topic-email-console-backend: |
