Django Commands: loaddata [your_fixture]

By: Dusty Arlia
Published on Saturday, April 12, 2014, 01:59 PM
Last Updated on Tuesday, July 07, 2015 at 10:07 PM
Total Updates: 2

The loaddata [your_fixture] loads the contents of the named fixture into your database. You can specify which database to load the data with the --database option. Use the --app option to specify a single Django app to look for fixtures in rather than looking through all your Django apps. Django searches three locations for your fixtures:

  • The fixtures directory of every installed application
  • Any directory in the FIXTURE_DIRS setting
  • The literal path named by the fixture

If certain fields were removed from your models after the fixture was originally generated, you can use the --ignorenonexistent option to ignore nonexistent fields.