﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36138	Simplify ADMINS and MANAGERS email list settings	Mike Edmunds	Mike Edmunds	"Django should allow the [https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-ADMINS ADMINS] and [https://docs.djangoproject.com/en/5.1/ref/settings/#managers MANAGERS] settings to be simple lists of email addresses, like this:

{{{#!python
# Doesn't work in Django through 5.2:
ADMINS = [""john@example.com"", ""mary@example.com""]
}}}

Right now, those settings both expect a list of tuples of (full name, email address). But the name part ''is ignored'' in both [https://github.com/django/django/blob/main/django/core/mail/__init__.py#L134 mail_admins()] and [https://github.com/django/django/blob/330d89d4fe7832355535580383523f1749a3ee45/django/core/mail/__init__.py#L154 mail_managers()]—and it's [https://github.com/django/django/blob/ed114e15106192b22ebb78ef5bf5bce72b419d13/django/core/mail.py#L43-L51 been ignored] for at least 20 years (as far back as the Git history goes):

{{{#!python
ADMINS = [(""name is ignored"", ""john@example.com""), (""ignored"", ""mary@example.com)]
}}}

#30604 added an error on detecting the (reasonable) mistake of trying to set ADMINS or MANAGERS to a simple list of addresses as in first example.

This ticket proposes instead allowing—and documenting—simple address lists in these settings. For compatibility __during a standard deprecation period__, Django would also continue to support the list-of-tuples form (with the name field ignored). __After deprecation, tuples would raise an error.__ [Edits: deprecated tuples, based on forum discussion.]

Incidentally, if you ''do'' want to include a display-name in the admins/managers recipients lists, that can be done with the RFC 5322 `""name"" <addr>` format (which is accepted by all the django.core.mail APIs):

{{{#!python
# Works in Django 5.2 and earlier:
ADMINS = [
    (""ignored"", ""John <john@example.com>""), 
    (""ignored"", '""Mary, IT (Ops)"" <mary@example.com>'),
]

# Also allowed after this proposed change:
ADMINS = [
    ""John <john@example.com>"", 
    '""Mary, IT (Ops)"" <mary@example.com>',
]
}}}"	New feature	closed	Core (Mail)	5.1	Normal	fixed			Ready for checkin	1	0	0	0	0	0
