django/django
Aymeric Augustin a4cb140004 Added get_app_config() to look up app configs by label.
Refactored get_app() to rely on that method.

get_app() starts by calling _populate(), which goes through
INSTALLED_APPS and, for each app, imports the app module and attempts to
import the models module. At this point, no further imports are
necessary to return the models module for a  given app. Therefore, the
implementation of get_app() can be simplified and the safeguards for
race conditions can be removed.

Besides, the emptyOK parameter isn't used anywhere in Django. It was
introduced in d6c95e93 but not actually used nor documented, and it has
just been carried around since then. Since it's an obscure private API,
it's acceptable to stop supporting it without a deprecation path. This
branch aims at providing first-class support for applications without a
models module eventually.

For backwards-compatibility, get_app() still raises ImproperlyConfigured
when an app isn't found, even though LookupError is technically more
correct. I haven't gone as far as to preserve the exact error messages.
I've adjusted a few tests instead.
2013-12-17 10:17:44 +01:00
..
apps Added get_app_config() to look up app configs by label. 2013-12-17 10:17:44 +01:00
bin Started attackign the next flake8 violation 2013-10-31 08:42:28 -07:00
conf Change initial migration writing to work as docs suggest. 2013-11-27 12:34:31 +00:00
contrib Removed module-level functions for the app cache. 2013-12-17 10:17:44 +01:00
core Removed unused attribute app_errors of the app cache. 2013-12-17 10:17:44 +01:00
db Removed unused attribute app_errors of the app cache. 2013-12-17 10:17:44 +01:00
dispatch Fixed E127 pep8 warnings. 2013-12-14 11:59:15 -05:00
forms Removed duplicated `TimeField` in __all__. 2013-12-16 17:52:37 -05:00
http Fixed E127 pep8 warnings. 2013-12-14 11:59:15 -05:00
middleware Fixed #21473 -- Limited language preservation to logout 2013-12-12 10:24:43 +01:00
template Fixed E127 pep8 warnings. 2013-12-14 11:59:15 -05:00
templatetags A handful of flake8 fixes 2013-11-23 08:26:11 -08:00
test Removed module-level functions for the app cache. 2013-12-17 10:17:44 +01:00
utils Removed unnecessary function-level import. 2013-12-16 15:30:51 +01:00
views Fixed #21564 -- Use local request object when possible in generic views. 2013-12-16 16:58:08 +01:00
__init__.py Started attackign the next flake8 violation 2013-10-31 08:42:28 -07:00
shortcuts.py Changed shortcuts from being a package to just being a module 2013-11-19 15:34:20 -08:00