django makemigrations报错

  错误类型1:

django.db.migrations.graph.NodeNotFoundError: Migration weather.0001_initial dependencies reference nonexistent parent node (u'machines', u'0006_auto_20150921_1327')

原因:是因为修改了model中的数据,找不到之前数据迁移的节点。

解决办法:删除migrations中除init.py的所有迁移文件,重新执行makemigrations

 错误类型2:

继承了abstractbaseuser/abstracuser 后执行数据迁移报错 (fields.E304) 

解决办法:在settings.py文件中加上
AUTH_USER_MODEL = 'appname.modelname'

  未完待续,继续更新。。。

 

猜你喜欢

转载自www.cnblogs.com/jimmyhe/p/10863620.html