Opened 5 months ago

Closed 5 months ago

#35231 closed New feature (wontfix)

Add system checks for settings types

Reported by: Alexander Lazarević Owned by: Alexander Lazarević
Component: Core (Other) Version: dev
Severity: Normal Keywords: systemchecks
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The discussion about this can be found on the forum at:

Use system checks to look for sane setting types at the start. Output would be something like this:

System check identified some issues:

?: (files.W001) The type of CACHE_MIDDLEWARE_SECONDS should be int (default 600). see

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.

Change History (2)

comment:1 by Alexander Lazarević, 5 months ago

Owner: changed from nobody to Alexander Lazarević
Status: newassigned

comment:2 by Mariusz Felisiak, 5 months ago

Resolution: wontfix
Status: assignedclosed

Closing as "wontfix" as we haven't reached a consensus on the forum (at least for now).

Note: See TracTickets for help on using tickets.
Back to Top