diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2013-06-29 18:19:20 -0300 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-06-29 18:19:20 -0300 |
| commit | 64cdea68e71829905da6374a066d1700375255ec (patch) | |
| tree | 16d4aa289284e296611d2a19cac96172c9e9e6a7 | |
| parent | 5e3a6532aab7bf51aa5857c3de9479a7be0c2ae4 (diff) | |
Report wrongly-typed settings and abort, as originally planned.
Thanks Claude for the heads up. Refs #12493 and commit 5e08b792.
| -rw-r--r-- | django/conf/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py index b1f40af80a..c98443be1a 100644 --- a/django/conf/__init__.py +++ b/django/conf/__init__.py @@ -132,9 +132,17 @@ class Settings(BaseSettings): % (self.SETTINGS_MODULE, e) ) + tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS") + for setting in dir(mod): if setting == setting.upper(): setting_value = getattr(mod, setting) + + if setting in tuple_settings and \ + isinstance(setting_value, six.string_types): + raise ImproperlyConfigured("The %s setting must be a tuple. " + "Please fix your settings." % setting) + setattr(self, setting, setting_value) if not self.SECRET_KEY: |
