﻿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
35231	Add system checks for settings types	Alexander Lazarević	Alexander Lazarević	"The discussion about this can be found on the forum at: https://forum.djangoproject.com/t/make-the-system-check-look-at-the-types-of-settings/27424

Use system checks to look for sane setting types at the start. Output would be something like this:

System check identified some issues:
{{{
WARNINGS:
?: (files.W001) The type of CACHE_MIDDLEWARE_SECONDS should be int (default 600). see https://docs.djangoproject.com/en/dev/ref/settings/#std-setting-CACHE_MIDDLEWARE_SECONDS
}}}

For some misconfigured settings there will still be an explicit ImproperlyConfigured exception raised (like The ALLOWED_HOSTS setting must be a list or a tuple) or an implicit exception like AttributeError: ‘int’ object has no attribute ‘find’ when for example set LANGUAGE_CODE to an int.

The implementation checks the type of the default value against the type of the user setting and issues a warning if they don’t match. This works for most settings, since they do have a default value other than None. For the ones that have None as the default value, a table is present, that contains the expected default values."	New feature	closed	Core (Other)	dev	Normal	wontfix	systemchecks		Unreviewed	1	0	0	0	0	0
