How to seed Django project ? – insert a bunch of data into the project for initialization
Similar to Rails, we also have option to seed the database. It is done using management commands. In one of your apps, use the following folder structure <project>/<app>/management/commands/seed.py this makes python manage.py seed available as a management command. I personally follow the following structure. # <project>/<app>/management/commands/seed.py from django.core.management.base import BaseCommand import random # python manage.py … Read more