﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33378	ImproperlyConfigured error is raised when installing apps in subdirectory	Zack West	nobody	"4.0 Throws an exception when installing apps that are located in subdirectories.

Example, for a project of such structure:


{{{
.
└── DjangoProject/
    └── Apps/
        ├── bestapp/
        │   ├── migrations
        │   ├── __init__.py
        │   ├── admin.py
        │   ├── apps.py
        │   ├── models.py
        │   ├── tests.py
        │   └── views.py
        └── ...
}}}

When adding this line to DjangoProject/settings.py:


{{{
INSTALLED_APPS = [
    ...
    'Apps.bestapp.apps.BestappConfig'
]
}}}

The following exception is thrown when running {{{python manage.py makemigrations}}}:


{{{
django.core.exceptions.ImproperlyConfigured: Cannot import 'bestapp'. Check that 'Apps.bestapp.apps.BestappConfig.name' is correct.

}}}

The current workaround is to go into the Apps/bestapp/apps.py file and make the following change:


Auto-generated version:
{{{
class BestappConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'bestapp' 
}}}

Manually-Updated version:
{{{
class BestappConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'Apps.bestapp' 
}}}

Note the change being adding the parent directory here: {{{name = 'Apps.bestapp' }}} 

IIRC, there was a syntax change for app installation somewhere in 3.x. Not sure if this is a product of that change or something else.
"	Bug	closed	Core (Management commands)	4.0	Normal	duplicate	Apps, Subdirectory, Installation		Unreviewed	0	0	0	0	0	0
