Skip to content
Vaisakh Rajagopal edited this page Aug 18, 2018 · 7 revisions

This will create dummy data using lorem ipsum, just for testing.

Steps:

  • pip3 install django-autofixture
  • add 'autofixture' to the INSTALLED_APPS setting in your django settings file.
  • Restart app

Run as needed:

python manage.py loadtestdata <app_name>.<model_name>:<#count>

Note: Please keep in mind the order matters if relationship(eg: foreign key) exist between the models.

  • python3 manage.py loadtestdata mainapp.RescueCamp:20 mainapp.DistrictCollection:20

  • python3 manage.py loadtestdata mainapp.Volunteer:20 mainapp.NGO:20 mainapp.Person:20 mainapp.DistrictNeed:20

  • python3 manage.py loadtestdata mainapp.DistrictManager:20 mainapp.Contributor:20 mainapp.Request:20

Clone this wiki locally