← All notes

Django fixtures: initial data for models

Answer: You can provide initial data with migrations or fixtures when you first set up an app. A data migration can load initial data automatically. Fixtures are another way to prepopulate the database with hard-coded data.

Notes

Migrations are run when setting up the test database, so migration-loaded data is available there, subject to some limitations. Fixtures are useful for hard-coded data, but a data migration is the usual way to load initial data for an app automatically.

Reference list

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Django docs, How to provide initial data for models; Django, initial-data.txt. BSD-3-Clause (https://raw.githubusercontent.com/django/django/main/LICENSE). Copyright Django Software Foundation and individual contributors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Django docs, How to provide initial data for models; Django, initial-data.txt. BSD-3-Clause (https://raw.githubusercontent.com/django/django/main/LICENSE). Copyright Django Software Foundation and individual contributors.

Cite this

Permanent ID: iil:note:7e2ckjtz

iinventedlight. 2026. "Django fixtures: initial data for models." iinventedlight Library, iil:note:7e2ckjtz, version of 2026-11-18. https://iinventedlight.com/library/notes/django-fixtures/. License: CC-BY-4.0.

@misc{iil_note_7e2ckjtz,
  author = {{iinventedlight}},
  title = {{Django fixtures: initial data for models}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/django-fixtures/},
  note = {Permanent ID iil:note:7e2ckjtz. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/django-fixtures.md.