You are trying to add a non-nullable field 'name' to contact without a default; we can't do that (the database needs something to populate existing rows).
Please select a fix:
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
解决方法(一):
先输入1,再在界面上输入默认值。
解决方法(二):
先给'name'任意初始值:name = models.CharField(max_length=50, default='abc')
然后执行:python manage.py makemirations
再执行:python manage.py migrate
再将default删去,即执行:name = models.CharField(max_length=50)
执行:python manage.py makemirations
再执行:python manage.py migrate