Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Error when running python manage.py loaddata datadump.json [RSS Feed]

#1 Dec. 6, 2010 22:55:12

j.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Error when running python manage.py loaddata datadump.json


I'm migrating my Django database from sqlite to mysql. I've done the
following with no problems:
python manage.py dumpdata > datadump.json Changed my settings.py to
the mysql database.

But when I issue the following command python manage.py loaddata
datadump.json I get this error:
IntegrityError: (1062, "Duplicate entry '13-13' for key
'from_category_id'")

How do I go go about fixing this issue so that I can run the command
again and hopefully load my data into my site?

thanks,
j.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 7, 2010 02:19:06

a.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Error when running python manage.py loaddata datadump.json


Generally when I get an error similar to that(not necessarily when
using django) It means that I have violated some field that has a
unique constraint. Look in you database and see if you have a
constrain on that table.

On Dec 6, 2:55 pm, jc <jimmy.case...@gmail.com> wrote:
> I'm migrating my Django database from sqlite to mysql. I've done the
> following with no problems:
> python manage.py dumpdata > datadump.json Changed my settings.py to
> the mysql database.
>
> But when I issue the following command python manage.py loaddata
> datadump.json I get this error:
> IntegrityError: (1062, "Duplicate entry '13-13' for key
> 'from_category_id'")
>
> How do I go go about fixing this issue so that I can run the command
> again and hopefully load my data into my site?
>
> thanks,
> j.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Error when running python manage.py loaddata datadump.json [RSS Feed]

Board footer

Moderator control

Enjoy the 17th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support