Python Model执行迁移数据库失败

报错形式+解决方案:

makemigrations

Please select a fix:

 1) Provide a one-off default now (will be set on all existing rows)
 2) Quit, and let me add a default in models.py
Select an option:  1
Please enter the default value now, as valid Python
The datetime and django.utils.timezone modules are available, so you can do e.g. timezone.now()

>>>  1

Migrations

猜你喜欢

转载自www.cnblogs.com/foreverstudy/p/10977939.html