1π
I assume you are using django 1.4 or later because of what is in your project folder.
Did you create the top-level directory with django-admin.py startproject
? I donβt see the __init__.py
file at the top level, although the project
directory with settings.py
and urls.py
is there. Create an empty file called __init__.py
at the top level (sibling of manage.py
) and see if that helps.
0π
Put your city (files which you want to import) in root dir of main application.
If IDE(PyCharm for an example) wont worry about import this module β than the problem was in paths.
Iβve smashed with this problem at once. And the problem paths were.
- [Answer]-Entire array interpreted as last element in array
- [Answer]-Django: views and assert like returns
- [Answer]-Cannot sync database for Django app on its Heroku postgres database
- [Answer]-Complex SQL syntax
0π
So I managed to fix the errors. Maybe I forgot some important info on the question but here is the explanation:
I downloaded PyDev for Eclipse and rebuilt the project from scratch. So, when I was writing the imports, Eclipse complained it was not right. Well, I went back to Django tutorial and there is import city
, so I was right. I accepted the suggestion from Eclipse and it changed to from city.models import City
and it went ok. So I tested with the old project and changed every import, and it validated and synced with no errors.
Now Iβm very confused, how could Django documentation be wrong? Or is this Python-version or distro peculiarity? Well, nevermind, it is now working. Thanks everybody π
- [Answer]-Setting up separate repositories for backend/frontend on heroku/github
- [Answer]-Django 1.5 view with related formset (master detail view)
- [Answer]-Calling Java API from Django