TypeError: int() argument must be a string, a bytes-like object or a number, not 'datetime.datetime' (venv_django2) anafde

因为不能删掉migrations文件夹。
更改default字段

from future import unicode_literals
from django.db import models, migrations
import datetime

class Migration(migrations.Migration):
dependencies = [ ('App11', '0003_remove_choice_question'), ]
operations = [
migrations.AddField(
model_name='choice',
name='question',
field=models.ForeignKey(default=1, to='App11.Question'), preserve_default=False, ),
]

解决的话删掉migrations 文件夹重新生成即可

你可能感兴趣的:(TypeError: int() argument must be a string, a bytes-like object or a number, not 'datetime.datetime' (venv_django2) anafde)