Hello,

Do you make python3 manage.py migrate after makemigrations?

Regards

Martin Kong <cok...@gmail.com> schrieb am Fr., 21. Juni 2019, 13:25:

> Hello
> I am new to django, and i am following the tutorial provide in github,
> from the tutorial.
> The tutorial I am following is
> https://github.com/django/django/blob/master/docs/intro/tutorial02.txt
>
> and  start from 227, it shows the following instructions:
>
> .. console::
> $ python manage.py makemigrations polls
> You should see something similar to the following:
> .. code-block:: text
> Migrations for 'polls':
> polls/migrations/0001_initial.py:
> - Create model Choice
> - Create model Question
> - Add field question to choice
> However, after following the steps
> I'm missing the last sentence (Add field question to choice) .
>
> The below is what i had written in model.py, did i make something wrong?
>
> Thanks
>
> 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, on_delete=models.CASCADE)
>     choice_text =  models.CharField(max_length=200)
>     votes = models.IntegerField(default=0)Thanks
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/CADEd1fars051JXymX0sbktNqKYak%2Bejv9uc2fGxxxbJe2Cnp1w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADEd1fars051JXymX0sbktNqKYak%2Bejv9uc2fGxxxbJe2Cnp1w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAKGT9mw6VfP_Ftrsz8iAGtXQ3mDXfeOgOxz7MfuYvejTNko8Gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to