已删除我的数据库。
已运行 SyncDb。
尝试从转储 ..-python manage.py loaddata dump.json 加载。
获取-“<1062 键的重复条目 ''..”
已运行“python manage.py reset contenttypes”
但是得到——
Error: Error: contenttypes couldn't be reset. Possible reasons:
* The database isn't running or isn't configured correctly.
* At least one of the database tables doesn't exist.
* The SQL was invalid.
Hint: Look at the output of 'django-admin.py sqlreset contenttypes'. That's the SQL this command wasn't able to run.
The full error: (1217, 'Cannot delete or update a parent row: a foreign key constraint fails')
尝试运行:
from django.core 导入管理
management.call_command("flush", verbosity=, interactive=False)
management.call_command("完全重置", "contenttypes", verbosity=, interactive=False)
management.call_command("loaddata", "full_test_data.json", verbosity=)
但是get-语法错误。
有python 2.7。和 Django 1.4
有任何想法吗?