Skip to content

Loading Sample Data

Our database only has the few rows our own seed command created. To test our app with data that looks real, I created a seed script that generates sample data for our site.

It's provided in this chapter's starting branch, with the photos in seed_photos/. The new seed.py replaces ours, and creates the animals, their photos, and their adoption applications.

Run the Command

Warning

--reset deletes every animal and adoption application in the database, and the photos the command saved, before it creates new ones.

Our database has the animals from our own seed, so we run it with --reset:

shell
uv run manage.py seed --reset
Text
...
Created 47 animals: 20 dogs, 20 cats, 7 rabbits. 39 available.
Copied 47 photos.
Created 12 adoption applications.
...

Without --reset, the command stops if the database already has animals.