I have two apps under one project and decide to move these two apps under apps
parent directory.
My current structure is,
project
- app1
- app2
- project
- __init__.py
- asgi.py
- settings.py
- urls.py
- wsgi.py
New structure I am trying to have,
project
- templates
- static
- apps
- app1
- app2
- project
- __init__.py
- asgi.py
- settings.py
- urls.py
- wsgi.py
Following to this, How to keep all my django applications in specific folder
I edited my settings.py
from os.path import abspath, basename, dirname, join
BASE_DIR = dirname(dirname(abspath(__file)))
PROJECT_ROOT = dirname(__file__)
sys.path.insert(0, join(PROJECT_ROOT, 'apps'))
INSTALLED_APPS = [
....
'apps.app1.apps.App1Config',
'apps.app2.apps.App2Config',
]
I got an error that
ModuleNOtFoundError: No module named 'app1'
Where should I have to edit to fix this issue?