I generated the device:
python manage.py dumpdata --all > ./mydump.json
I emptied all my databases using:
python manage.py sqlflush | psql mydatabase -U mydbuser
But when I try to use loaddata:
python manage.py loaddata ./mydump.json
I get this error:
IntegrityError: Could not load tastypie.ApiKey(pk=1): duplicate key
value violates unique constraint "tastypie_apikey_user_id_key"
DETAIL: Key (user_id)=(2) already exists.
I have a production problem and I have no ideas. Has anyone had a similar problem?
source
share