I just opened a new Djangoproject with v3.2 and tried to import my apps as usual, when I got an ImproperlyConfigured Exception on one of my apps.
Steps:
The result, when trying to runserver
\lib\site-packages\django\apps\config.py", line 246, in create
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Cannot import 'core'. Check that
'apps.core.apps.CoreConfig.name' is correct.
Structure
-- project
-- apps
-- core
-- apps.py
-- project
-- manage.py
core\apps.py
class CoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'core'
The auto_field seems to be new as it was not integrated in earlier versions, however, this should not affect the importation if I understand this correctly.
I returned to v3.1.3 to check if something else went wrong, but it is working fine with this approach.
Does anyone have the same issues or have a solution?
Thanks
I hit the same problem, also on an app named apps.core
(coincidence).
With Django >= 3.1, you're required to fully qualify the name:
class CoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'apps.core'
Seems to work for 3.0 as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With