Reputation: 9289
ImportError: no module named location.models
at the following line:
from location.models import Zipcode
But there is a models.py
, an __init__.py
, and a Zipcode
model in an installed app called location
in my project.
Further, the module is easily imported in the python shell using the same command. What could be the problem here? Thanks for your ideas!
Upvotes: 5
Views: 7263
Reputation: 9289
Thanks for your commentary @Marcin. Turns out that I had a file called location.py
in my views.py
folder, which was causing some kind of conflict. I renamed this file location_view.py
and voila.
So moral of the story, I guess, is check to make sure that you dont have any name conflicts in an app when you are trying to import an app of the same name..
Upvotes: 4