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!
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..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With