I am following the official Django documentation and trying to make the polls app. But when I run the command python manage.py makemigrations polls I get the console error.

10 views
Skip to first unread message

Avitab Ayan Sarmah

unread,
Apr 30, 2018, 3:29:17 PM4/30/18
to Django users

The code I am using for the models is:

from django.db import models


class Question(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')


class Choice(models.Model):
   question = models.ForeignKey(Question)
   choice_text = models.CharField(max_length=200)
   votes = models.IntegerField(default=0)
The code i am using for mysite/settings is:
INSTALLED_APPS = [
    'polls.apps.PollsConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

It would be great if you could point out the error.
Capture.PNG

George Lubaretsi

unread,
Apr 30, 2018, 3:33:34 PM4/30/18
to django...@googlegroups.com
Looks like you have a typo somewhere.

Exception says that it can't find a module `polss` while it should be `polls`. Check your settings and imports

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/434e4e83-13f5-4688-b388-6c4d767a5273%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Avitab Ayan Sarmah

unread,
Apr 30, 2018, 4:29:52 PM4/30/18
to django...@googlegroups.com
Yes I found the error George, I mistakenly typed polss in settings. Now the code is running fine

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/zgCUS5eWxOs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages