Changes between Initial Version and Version 1 of Ticket #31560, comment 3
- Timestamp:
- Jul 3, 2020, 4:21:08 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31560, comment 3
initial v1 2 2 > Thanks for this report, Can you provide a sample project? All my attempts raise an `ImportError` (even with circular imports in `apps.py`) 3 3 4 I had this problem and managed to debug it right now. It will happen when Django's app registry imports the app's module added in INSTALLED_APPS and that module imports, directly or indirectly, a model of the app being loaded . Reading the docs [https://docs.djangoproject.com/en/3.0/ref/applications/] there are no notes warning about it.4 I had this problem and managed to debug it right now. It will happen when Django's app registry imports the app's module added in INSTALLED_APPS and that module imports, directly or indirectly, a model of the app being loaded . Reading the docs [https://docs.djangoproject.com/en/3.0/ref/applications/] there are no notes warning about it. 5 5 6 6 **Steps to reproduce** … … 10 10 4. Add the app's dotted path to INSTALLED_APPS 11 11 5. Try to run with {{{ ./manage.py runserver }}} 12 You will get the error {{{ django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. }}} 12 You will get the error {{{ django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. }}}. At a model's import time, the model metaclass will check whether its app is ready, but it is not, so the AppRegistryNotReady will be raised since the registry is being populated. 13 13 14 Since it's caused by Django, I think Django should be able to detect it and output a meaning error message