summaryrefslogtreecommitdiff
path: root/django/utils/module_loading.py
AgeCommit message (Collapse)Author
2015-11-17Fixed #25682 -- Removed bare except clauses.Attila Tovt
2015-06-18Removed support for Python 3.3.Tim Graham
2015-06-06Fixed ImportError message in utils.module_loading.import_string()Tomasz Kontusz
2015-02-23Prevented makemigrations from writing in sys.path[0].Aymeric Augustin
There's no reason to assume that sys.path[0] is an appropriate location for generating code. Specifically that doesn't work with extend_sys_path which puts the additional directories at the end of sys.path. In order to create a new migrations module, instead of using an arbitrary entry from sys.path, import as much as possible from the path to the module, then create missing submodules from there. Without this change, the tests introduced in the following commit fail, which seems sufficient to prevent regressions for such a refactoring.
2015-02-09Removed some obsolete absolute_imports.Tim Graham
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-18Removed utils.module_loading.import_by_path() per deprecation timeline; refs ↵Tim Graham
#21674.
2014-10-31Fixed #23670 -- Prevented partial import state during module autodiscoveryMarkus Holtermann
Thanks kostko for the report.
2014-06-07Simplified module_has_submodule on Python >= 3.3.Aymeric Augustin
Stopped using the imp module on Python >= 3.3. Refs #21628.
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2014-02-08Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag
import_string(). Thanks Aymeric Augustin for the suggestion and review.
2014-01-12Used a regular lock for app registry population.Aymeric Augustin
Since the app registry is always populated before the first request is processed, the situation described in #18251 for the old app cache cannot happen any more. Refs #18251, #21628.
2013-12-26Made the AppConfig API marginally more consistent.Aymeric Augustin
Eliminated the app_ prefix that was more confusing than useful.
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-22Stopped iterating on INSTALLED_APPS.Aymeric Augustin
Used the app cache's get_app_configs() method instead.
2013-12-22Added a context manager to hold the import lock.Aymeric Augustin
2013-09-13Fixed #21060 -- Refactored admin's autodiscover method to make it reusable.Juan Catalano
We want to be able to use it for instance for discovering `tasks.py` modules inside the INSTALLED_APPS. This commit therefore moves the logic to `autodiscover_modules` method in django.utils.module_loading.
2013-08-19Avoid importing the deprecated `django.utils.importlib` package.Simon Charette
2013-07-29Deprecated django.utils.importlibClaude Paroz
This was a shim for pre-Python 2.7 support.
2013-03-31Fixed #20167 -- Preserve the traceback of `ImportError`s in `import_by_path`.Joe Friedl
Thanks @carljm for the review.
2013-02-04Fixed #17061 -- Factored out importing object from a dotted pathClaude Paroz
Thanks Carl Meyer for the report.
2011-08-28Fixed #15525 -- Custom template tags loading breaks whenever templatetags is ↵Chris Beaven
a python file git-svn-id: http://code.djangoproject.com/svn/django/trunk@16703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-10Properly implement PEP 302 in the module_loading module. For unknown ↵Alex Gaynor
reasons this doesn't actually raise an error under CPython, but PyPy does, and the currently implementation is clearly in violation of the PEP, which states that finder.find_module's second argument is either None or package.__path__ and imp.find_module whose second argument should be either None or a list of paths. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22Fixed #15662 -- Made sure the module_has_submodule utility function follow ↵Jannis Leidel
correct PEP 302, passing the package as the second argument to the find_module method of the importer. Thanks, Bradley Ayers. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16075 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-30Fixed #14698 -- Ensure that module_has_sumodule doesn't mistake a cache miss ↵Russell Keith-Magee
for an existent package. Thanks to Łukasz Rekucki for the report and patch, and to shields for the test case. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15362 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04Fixed #13464 -- Reworked module_has_submodule to break the requirement for ↵Russell Keith-Magee
loader and finder to be the same class. Thanks to Alex Gaynor for the report and patch, and Brett Cannon for suggesting the approach. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13082 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-25Fixed #13404 -- Reworked module_has_submodule() to allow it to work under ↵Russell Keith-Magee
AppEngine. Thanks to Waldemar Kornewald for the report and testing help. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13023 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-15Fixed #13348: Restored ability to load models from apps in eggs. Thanks ↵Karen Tracey
Ramiro and metzen for pointers on how to find out if a module loaded from an egg has a particular submodule. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12982 bcc190cf-cafb-0310-a4f2-bffc1f526a37