importing modules

PyCharm is not recognizing paths that I want to import.

My file structure is like this:
project:
  – web:
  – djanogapp:
    – app1
    – app2
    – app3
  – other folders

django lives in djangoapp. Let's say that I want to import a module from app1 into app2. Autocomplete and such only works if I do something like:

from djangoapp.app1.models import SomeModel

I want to ommit djangoapp from the import statement, so that I can write it as:

from app1.models import SomeModel

How do I go about setting up PyCharm for that?

Thanks.
2 comments
You need to mark the djangoapp directory as a source root in Settings | Project Structure.
0
Thanks. That did it!

Sent from a mobile device.
0

Please sign in to leave a comment.