﻿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
88	Configuration should be more forgiving to users who forget the trailing comma.	mmarshall	Adrian Holovaty	"It is really easy for users to forget the trailing comma in configuration settings that should be a tuple, resulting in weird errors.  In order to help keep (new) users from getting frustrated, a string should be converted into a tuple for these settings.

Here is a patch to implement this:

{{{
Index: django/conf/settings.py
===================================================================
--- django/conf/settings.py     (revision 211)
+++ django/conf/settings.py     (working copy)
@@ -29,9 +29,16 @@
 except ImportError, e:
     raise EnvironmentError, ""Could not import DJANGO_SETTINGS_MODULE '%s' (is it on sys.path?): %s"" % (me.SETTINGS_MODULE, e)

+
+# a list of settings that should be converted into tuples if they are strings:
+tuple_settings = [""INSTALLED_APPS"",""TEMPLATE_DIRS""]
+
 for setting in dir(mod):
     if setting == setting.upper():
-        setattr(me, setting, getattr(mod, setting))
+        setting_value = getattr(mod, setting)
+        if setting in tuple_settings and type(setting_value) == str:
+            setting_value = (setting_value,) #In case the user forgot the comma.
+        setattr(me, setting, setting_value)

 # save DJANGO_SETTINGS_MODULE in case anyone in the future cares
 me.SETTINGS_MODULE = os.environ.get('DJANGO_SETTINGS_MODULE', '')
}}}

Note that I only put two entries in the tuple_settings list, as they are the only ones I know of.  If there are more, they should be added."	defect	closed	Core (Other)		trivial	fixed			Accepted	0	0	0	0	0	0
