summaryrefslogtreecommitdiff
path: root/django/utils/module_loading.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-11/+12
|
* Refs #33107 -- Optimized cached_import() helper.Nick Pope2021-10-041-7/+7
|
* Fixed #33107 -- Fixed import_string() crash on not fully initialized modules.Mariusz Felisiak2021-09-161-1/+5
| | | | | Regression in ecf87ad513fd8af6e4a6093ed918723a7d88d5ca. Thanks Collin Anderson for the report.
* Fixed #33099 -- Improved performance of import_string().yujin2021-09-101-3/+9
| | | | | | | This improves performance of import_string() by avoiding multiple imports for the same path. Thanks Andrew Godwin and Keryn Knight for the implementation idea.
* Refs #32355 -- Corrected comments about Python's _NamespacePath.William Schwartz2021-03-261-1/+1
| | | | _NamespacePath supports indexing in Python 3.8+.
* Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak2021-02-101-3/+2
|
* Fixed #30116 -- Dropped support for Python 3.5.Tim Graham2019-01-301-5/+4
|
* Refs #29784 -- Switched to https:// links where available.Jon Dufresne2018-09-261-1/+1
|
* Fixed #28241 -- Allowed module_has_submodule()'s module_name arg to be a ↵Thomas Khyn2017-06-081-1/+8
| | | | dotted path.
* Refs #23919 -- Replaced six.reraise by raiseClaude Paroz2017-01-221-9/+5
|
* Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz2017-01-181-82/+12
| | | | Thanks Tim Graham for the review.
* Fixed #25682 -- Removed bare except clauses.Attila Tovt2015-11-171-1/+1
|
* Removed support for Python 3.3.Tim Graham2015-06-181-5/+2
|
* Fixed ImportError message in utils.module_loading.import_string()Tomasz Kontusz2015-06-061-1/+1
|
* Prevented makemigrations from writing in sys.path[0].Aymeric Augustin2015-02-231-0/+18
| | | | | | | | | | | | | 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.
* Removed some obsolete absolute_imports.Tim Graham2015-02-091-3/+0
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-2/+3
|
* Removed utils.module_loading.import_by_path() per deprecation timeline; refs ↵Tim Graham2015-01-181-21/+0
| | | | #21674.
* Fixed #23670 -- Prevented partial import state during module autodiscoveryMarkus Holtermann2014-10-311-18/+18
| | | | Thanks kostko for the report.
* Simplified module_has_submodule on Python >= 3.3.Aymeric Augustin2014-06-071-57/+77
| | | | Stopped using the imp module on Python >= 3.3. Refs #21628.
* Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz2014-03-081-1/+2
| | | | | Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
* Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag2014-02-081-11/+26
| | | | | | import_string(). Thanks Aymeric Augustin for the suggestion and review.
* Used a regular lock for app registry population.Aymeric Augustin2014-01-121-13/+0
| | | | | | | | 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.
* Made the AppConfig API marginally more consistent.Aymeric Augustin2013-12-261-1/+1
| | | | Eliminated the app_ prefix that was more confusing than useful.
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-2/+2
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Stopped iterating on INSTALLED_APPS.Aymeric Augustin2013-12-221-5/+4
| | | | Used the app cache's get_app_configs() method instead.
* Added a context manager to hold the import lock.Aymeric Augustin2013-12-221-0/+13
|
* Fixed #21060 -- Refactored admin's autodiscover method to make it reusable.Juan Catalano2013-09-131-0/+38
| | | | | | | | 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.
* Avoid importing the deprecated `django.utils.importlib` package.Simon Charette2013-08-191-0/+2
|
* Deprecated django.utils.importlibClaude Paroz2013-07-291-1/+1
| | | | This was a shim for pre-Python 2.7 support.
* Fixed #20167 -- Preserve the traceback of `ImportError`s in `import_by_path`.Joe Friedl2013-03-311-2/+5
| | | | Thanks @carljm for the review.
* Fixed #17061 -- Factored out importing object from a dotted pathClaude Paroz2013-02-041-0/+26
| | | | Thanks Carl Meyer for the report.
* Fixed #15525 -- Custom template tags loading breaks whenever templatetags is ↵Chris Beaven2011-08-281-2/+8
| | | | | | a python file git-svn-id: http://code.djangoproject.com/svn/django/trunk@16703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Properly implement PEP 302 in the module_loading module. For unknown ↵Alex Gaynor2011-07-101-1/+1
| | | | | | 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
* Fixed #15662 -- Made sure the module_has_submodule utility function follow ↵Jannis Leidel2011-04-221-1/+1
| | | | | | 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
* Fixed #14698 -- Ensure that module_has_sumodule doesn't mistake a cache miss ↵Russell Keith-Magee2011-01-301-2/+5
| | | | | | 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
* Fixed #13464 -- Reworked module_has_submodule to break the requirement for ↵Russell Keith-Magee2010-05-041-21/+55
| | | | | | 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
* Fixed #13404 -- Reworked module_has_submodule() to allow it to work under ↵Russell Keith-Magee2010-04-251-5/+4
| | | | | | 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
* Fixed #13348: Restored ability to load models from apps in eggs. Thanks ↵Karen Tracey2010-04-151-0/+27
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