There are numerous similar questions here on SO, but they all seem to be for older versions, or are related to a typo.
In part 2 of the Django 1.9 tutorial, I am stuck at the initial migration for the polls app:
python manage.py makemigrations polls
When running this, I get the error: `ImportError: No module named 'polls.apps'
I am using Python 3.5.1
and Django 1.9.4
excerpt from mysite/settings.py
...
INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
...
Folder structure:
.
├── db.sqlite3
├── manage.py
├── mysite
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── __pycache__
│ ├── settings.py
│ ├── settings.pyc
│ ├── urls.py
│ └── wsgi.py
└── polls
├── __init__.py
├── __pycache__
├── admin.py
├── models.py
├── tests.py
├── urls.py
└── views.py
4 directories, 21 files
You are missing the apps.py
file (and the polls.migrations
package also) which should have been generated on this step: Creating the Polls app. Please review to ensure you've completed that step correctly.
What about if you replace
INSTALLED_APPS = [
'polls.apps.PollsConfig',
...
]
by just
INSTALLED_APPS = [
'polls',
...
]
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