My application was working fine when I wanted to see whether I could organize my project in a better way. I read through this tutorial on structuring a django project.
Before my project structure was as follows:
- camucamu
- books
- admin.py
- models.py
- views.py
- __init__.py
- static
- templates
- urls.py
- views.py
- settings.py
- wsgi.py
- __init__.py
- books
What I wanted to do was move the books app into an apps folder. Thus I did that and changed the project structure to the following:
- camucamu
- apps
- books
- admin.py
- models.py
- views.py
- __init__.py
- books
- static
- templates
- urls.py
- views.py
- settings.py
- wsgi.py
- __init__.py
- apps
I then changed the imports in views.py and admin.py
from books.models to apps.books.models.
I also changed INSTALLED_APPS
in settings.py from books to apps.books.
When I then tried to run syncdb, I get the following error:
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError apps.books: No module named apps.books
What am I messing up here so it can't find my app anymore?
manage.py
? – Ahsan