Django - DatabaseError: No such table

前端 未结 5 878
不知归路
不知归路 2021-02-04 11:12

I defined two models:

class Server(models.Model):
    owners = models.ManyToManyField(\'Person\')

class Person(models.Model):
    name = models.CharField(max_le         


        
5条回答
  •  故里飘歌
    2021-02-04 11:47

    I meet the same problem today and fix it. I think you miss some command in tutorial 1. just do follow:

    ./python manage.py makemigrations polls
    python manage.py sql polls
    ./python manage.py syncdb
    

    then fix it and gain the table polls and you can see the table created. you should read the manage.py makemigrations command.

提交回复
热议问题