Trying to run a Django project with this structure:

projectx

├──apps │ ├── app1 | | ├── __init__.py | | └── ... │ └── app2 | ├── __init__.py | └── ... ├──project │ ├── settings.py │ ├── urls.py │ ├── __init__.py | └── ... ├── manage.py └── ... 

During startup: python manage.py runserver I get ImportError: No module named apps

$ echo $PYTHONPATH gives
/ home / alexander / Work / projectx

Django version 1.9.8

 INSTALLED_APPS = [ ... 'apps.app1', 'apps.app2' ] 

My colleague launches this project without any changes, I think the point is in the PYTHONPATH variable.

  • A colleague is exactly launching just such a project, and without the apps/__init__.py ? For without him, he in theory and should not run - andreymal
  • @andreymal, yes. If you add it, then there are already other ImportError'y, already due to the fact that the python is looking for something first thing in apps.py, which lie closer than in the apps / directory - Alexander Borodin
  • So it would be necessary to attach these other ImportErrors too - andreymal

0