类新增字段de方法


 1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
 2) Quit, and let me add a default in models.py
Select an option:

 

book新添加一个字段author,然后执行python manage.py makemigrations 之后出现这个,选项一表示添加默认值,选项二退出,此时选1,输入默认值

。加上引号。

然后python manege.py migrate

 

posted @ 2018-08-06 14:38  未来的技术  阅读(129)  评论(0编辑  收藏  举报