mirror of
https://github.com/django/django.git
synced 2025-10-28 08:06:09 +00:00
Fixed #21874 -- Require Django applications to have a filesystem path.
Wherever possible this filesystem path is derived automatically from the app module's ``__path__`` and ``__file__`` attributes (this avoids any backwards-compatibility problems). AppConfig allows specifying an app's filesystem location explicitly, which overrides all autodetection based on ``__path__`` and ``__file__``. This permits Django to support any type of module as an app (namespace packages, fake modules, modules loaded by other hypothetical non-filesystem module loaders), as long as the app is configured with an explicit filesystem path. Thanks Aymeric for review and discussion.
This commit is contained in:
@@ -73,8 +73,11 @@ class ProjectState(object):
|
||||
|
||||
class AppConfigStub(AppConfig):
|
||||
"""
|
||||
Stubs a Django AppConfig. Only provides a label and a dict of models.
|
||||
Stubs a Django AppConfig. Only provides a label, and a dict of models.
|
||||
"""
|
||||
# Not used, but required by AppConfig.__init__
|
||||
path = ''
|
||||
|
||||
def __init__(self, label):
|
||||
super(AppConfigStub, self).__init__(label, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user