Ticket #6677: django_conf_init.patch
File django_conf_init.patch, 1.3 KB (added by , 17 years ago) |
---|
-
django/conf/__init__.py
8 8 9 9 import os 10 10 import time # Needed for Windows 11 import sets 11 12 from django.conf import global_settings 12 13 13 14 ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE" … … 99 100 100 101 # Expand entries in INSTALLED_APPS like "django.contrib.*" to a list 101 102 # of all those apps. 102 new_installed_apps = []103 new_installed_apps = sets.Set() 103 104 for app in self.INSTALLED_APPS: 104 105 if app.endswith('.*'): 105 106 appdir = os.path.dirname(__import__(app[:-2], {}, {}, ['']).__file__) 106 107 for d in os.listdir(appdir): 107 108 if d.isalpha() and os.path.isdir(os.path.join(appdir, d)): 108 new_installed_apps.a ppend('%s.%s' % (app[:-2], d))109 new_installed_apps.add('%s.%s' % (app[:-2], d)) 109 110 else: 110 new_installed_apps.a ppend(app)111 self.INSTALLED_APPS = new_installed_apps111 new_installed_apps.add(app) 112 self.INSTALLED_APPS = list(new_installed_apps) 112 113 113 114 if hasattr(time, 'tzset'): 114 115 # Move the time zone info into os.environ. See ticket #2315 for why