Ticket #16247: 16247.diff
File 16247.diff, 2.4 KB (added by , 13 years ago) |
---|
-
docs/releases/1.4.txt
363 363 Some legacy ways of calling :func:`~django.views.decorators.cache.cache_page` 364 364 have been deprecated, please see the docs for the correct way to use this 365 365 decorator. 366 367 Wildcard expansion of application names in `INSTALLED_APPS` 368 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 369 370 Until Django 1.3, :setting:`INSTALLED_APPS` accepted wildcards in application 371 names, like ``django.contrib.*``. The expansion was performed by a crude 372 filesystem-based implementation of ``from <package> import *``. Unfortunately, 373 `this can't be done reliably`_. 374 375 This behavior was never documented. Since it is prone to unexpected 376 side-effects, un-pythonic and not obviously useful, it was removed in Django 377 1.4. If you relied on it, you must edit your settings file to list all your 378 applications explicitly. 379 380 .. _this can't be done reliably: http://docs.python.org/tutorial/modules.html#importing-from-a-package -
django/conf/__init__.py
99 99 setting_value = (setting_value,) # In case the user forgot the comma. 100 100 setattr(self, setting, setting_value) 101 101 102 # Expand entries in INSTALLED_APPS like "django.contrib.*" to a list103 # of all those apps.104 new_installed_apps = []105 for app in self.INSTALLED_APPS:106 if app.endswith('.*'):107 app_mod = importlib.import_module(app[:-2])108 appdir = os.path.dirname(app_mod.__file__)109 app_subdirs = os.listdir(appdir)110 app_subdirs.sort()111 name_pattern = re.compile(r'[a-zA-Z]\w*')112 for d in app_subdirs:113 if name_pattern.match(d) and os.path.isdir(os.path.join(appdir, d)):114 new_installed_apps.append('%s.%s' % (app[:-2], d))115 else:116 new_installed_apps.append(app)117 self.INSTALLED_APPS = new_installed_apps118 119 102 if hasattr(time, 'tzset') and self.TIME_ZONE: 120 103 # When we can, attempt to validate the timezone. If we can't find 121 104 # this file, no check happens and it's harmless.