# 修改settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'test',
'HOST':'127.0.0.1',
'PORT':3306,
'USER':'root',
'PASSWORD':'123',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
}
}
}
# 添加以下代码,取消外键检查
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
}
标签:fails,constraint,utils,db,django,key,child,foreign
From: https://www.cnblogs.com/wxlxl/p/16985870.html