Changes between Initial Version and Version 1 of Ticket #30111, comment 2
- Timestamp:
- Jan 17, 2019, 3:24:56 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30111, comment 2
initial v1 6 6 When contrib.postgres is in INSTALLED_APPS it triggers from **django.db.migrations.writer import MigrationWriter** import in [https://github.com/django/django/blob/7185ea6902532eb195d0575d1bf1492ca9d45dea/django/contrib/postgres/apps.py#L8 django/django/contrib/postgres/apps.py] which further triggered **app_config = apps.get_containing_app_config(module)** import in [https://github.com/django/django/blob/7185ea6902532eb195d0575d1bf1492ca9d45dea/django/db/models/base.py#L99 ModelBase] Meta class. 7 7 ModelBase checks for self.check_apps_ready() while apps have not been completely loaded yet. So an exception is raised **raise AppRegistryNotReady("Apps aren't loaded yet.")** 8 I've changed **django/django/contrib/postgres/apps.py** to import MigrationWriter only when needed to avoid **check for apps ready** cycle to fix the issue 8 Fix: I've changed **django/django/contrib/postgres/apps.py** to import MigrationWriter only when needed to avoid **check for apps ready** cycle. 9 9 10 10