Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 57d2a0f62c0b95e79e1262d4331b3e2c71e6ced6 1 parent d38e882
Jacob Kaplan-Moss authored November 11, 2005

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  django/conf/settings.py
13  django/conf/settings.py
@@ -44,6 +44,19 @@
44 44
             setting_value = (setting_value,) # In case the user forgot the comma.
45 45
         setattr(me, setting, setting_value)
46 46
 
  47
+# Expand entries in INSTALLED_APPS like "django.contrib.*" to a list
  48
+# of all those apps.
  49
+new_installed_apps = []
  50
+for app in me.INSTALLED_APPS:
  51
+    if app.endswith('.*'):
  52
+        appdir = os.path.dirname(__import__(app[:-2], '', '', ['']).__file__)
  53
+        for d in os.listdir(appdir):
  54
+            if d.isalpha() and os.path.isdir(os.path.join(appdir, d)):
  55
+                new_installed_apps.append('%s.%s' % (app[:-2], d))
  56
+    else:
  57
+        new_installed_apps.append(app)
  58
+me.INSTALLED_APPS = new_installed_apps
  59
+
47 60
 # save DJANGO_SETTINGS_MODULE in case anyone in the future cares
48 61
 me.SETTINGS_MODULE = os.environ.get(ENVIRONMENT_VARIABLE, '')
49 62
 

0 notes on commit 57d2a0f

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