How to create a fixture file

Viktor Apoyan picture Viktor Apoyan · May 27, 2011 · Viewed 54.7k times · Source

I want to create a fixture file in my Django project.

How can I do this?

Answer

S.Lott picture S.Lott · May 27, 2011

Read “Providing initial data for models”.

  1. Load some data into a Django-managed database. Simple Python scripts work nicely, Or use the default admin interface.
  2. Use manage.py dumpdata to dump the data into a JSON fixture file. Read "django-admin.py and manage.py".