diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2005-11-11 02:52:16 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2005-11-11 02:52:16 +0000 |
| commit | 57d2a0f62c0b95e79e1262d4331b3e2c71e6ced6 (patch) | |
| tree | ff69c29007c41d4b62ec5ea00f0337f730ce7bd2 | |
| parent | d38e882695f7cbeed645346281eaa9b651619a48 (diff) | |
Entries in INSTALLED_APPS can now be of the form "django.contrib.*", which
means every app under "django.contrib".
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1163 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/conf/settings.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/django/conf/settings.py b/django/conf/settings.py index 2001a06ffd..f455f65afe 100644 --- a/django/conf/settings.py +++ b/django/conf/settings.py @@ -44,6 +44,19 @@ for setting in dir(mod): setting_value = (setting_value,) # In case the user forgot the comma. setattr(me, setting, setting_value) +# Expand entries in INSTALLED_APPS like "django.contrib.*" to a list +# of all those apps. +new_installed_apps = [] +for app in me.INSTALLED_APPS: + if app.endswith('.*'): + appdir = os.path.dirname(__import__(app[:-2], '', '', ['']).__file__) + for d in os.listdir(appdir): + if d.isalpha() and os.path.isdir(os.path.join(appdir, d)): + new_installed_apps.append('%s.%s' % (app[:-2], d)) + else: + new_installed_apps.append(app) +me.INSTALLED_APPS = new_installed_apps + # save DJANGO_SETTINGS_MODULE in case anyone in the future cares me.SETTINGS_MODULE = os.environ.get(ENVIRONMENT_VARIABLE, '') |
