I am working on this Django tutorial and am getting this error: "Error: No module named polls" when I type "python manage.py sql polls" in the terminal. I have no clue how to fix this problem. Any help would be greatly appreciated.
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'polls' # THIS IS THE ANSWER
)
There is an error in the documentation. Type polls
instead of mysite.polls
.
Ismael's answer worked for me.
Originally had
urlpatterns = patterns('',
(r'^polls/$ ,'mysite.polls.views.index'),
)
Changed to
urlpatterns = patterns('',
(r'^polls/$ ,'polls.views.index'),
)
If you have added polls app inside the setting.py please remove that and try recreating the polls and then add to the setting.py file. This solved my issue :)
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
#Remove the below application and try again
#'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