importing modules

PyCharm is not recognizing paths that I want to import.

My file structure is like this:
  – 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?

Comment actions Permalink
You need to mark the djangoapp directory as a source root in Settings | Project Structure.
Comment actions Permalink
Thanks. That did it!

Sent from a mobile device.

Please sign in to leave a comment.