Skip to content
Browse files

Fixed #88 -- settings are now forgiving of single-element INSTALLED_A…

…PPS and TEMPLATE_DIRS without trailing commas.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent df66763 commit e29afe7974c169f0028c71b6c33a793bc5f7464d @adrianholovaty adrianholovaty committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 django/conf/
9 django/conf/
@@ -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)
+# Settings that should be converted into tuples if they're mistakenly entered
+# as 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

0 comments on commit e29afe7

Please sign in to comment.
Something went wrong with that request. Please try again.