0

I try to figure it out why can't I import a module but I have no success. My structure is very simple:

exitinterview
firm
stressz
    -models.py
performance
    -emails.py 

I want to import Projects class from stressz.models into emails.py like this:

from stressz.models import Project

But I always get this error:

ModuleNotFoundError: No module named 'stressz'

I have stressz in my settings.py in the INSTALLED_APPS

RlM
  • 183
  • 12

1 Answers1

0

You do not mention where your project folder is.

If you follow this structure, you should solve this issue:

.
manage.py
├── app1
     └── models.py
├── app2
     └── models.py
└── project
     └── settings.py

For more best practice in working directory, you can read more here: Best practice for Django project working directory structure

ErikR
  • 560
  • 5
  • 13