python 在makemigrations时报Please select a fix:...

解决方案:

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

你可能感兴趣的:(python)