Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKeifer Joedicker
5,869 PointsCan't get loaddata to do what I want
I started a new Django project, the database I had before was still relevant so Iattempting to merge it over to the new one using dumpdata & loaddata.
The problem is when I go to use loaddata I get this error:
"bad_row[1], referenced_table_name, referenced_column_name, django.db.utils.IntegrityError: Problem installing fixtures: The row in table 'django_admin_log' with primary key '1' has an invalid foreign key: django_admin_log.content_type_id contains a value '7' that does not have a corresponding value in django_content_type.id."
The steps I followed to get here are:
- Copied and migrated the models page from my first app to my new own.
- python3 manage.py dumpdata admin > db.json --indent 2
- python3 manage.py loaddata db.json