Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Help with "Error: No module named polls" from the Django Project Tutorial 1

Tags:

django

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.

like image 253
AKatz Avatar asked Jul 02 '11 01:07

AKatz


4 Answers

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
)
like image 67
natttoku Avatar answered Nov 20 '22 13:11

natttoku


There is an error in the documentation. Type polls instead of mysite.polls.

like image 25
tsil Avatar answered Nov 20 '22 11:11

tsil


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'),
)
like image 32
user1376892 Avatar answered Nov 20 '22 13:11

user1376892


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',
)
like image 2
Shahabaz Avatar answered Nov 20 '22 11:11

Shahabaz