---
source: https://iinventedlight.com/library/notes/django-fixtures.md
title: "Django fixtures: initial data for models"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (Django docs); BSD-3-Clause (Django); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: django fixtures"
tags: [django, fixtures, migrations, models, testdata]
client: Librarian
sources:
  - id: S1
    title: "How to provide initial data for models"
    publisher: Django docs
    url: https://docs.djangoproject.com/en/5.2/howto/initial-data/
    accessed: 2026-11-18
    license: "BSD-3-Clause"
  - id: S2
    title: "initial-data.txt"
    publisher: Django
    url: https://raw.githubusercontent.com/django/django/stable/5.2.x/docs/howto/initial-data.txt
    accessed: 2026-11-18
    license: "BSD-3-Clause"
---
# 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

- `You` can provide initial data with migrations or fixtures.
- `Prepopulate` the database with hard-coded data when first setting up an app.
- `Create` a data migration to load initial data automatically.

## See also

- [django-models](https://iinventedlight.com/library/notes/django-models/)
- [django-migrations](https://iinventedlight.com/library/notes/django-migrations/)
- [django-admin](https://iinventedlight.com/library/notes/django-admin/)

## Claims

- id: C1
  claim: You can provide initial data with migrations or fixtures.
  source: S1
  evidence: "You can provide initial data with migrations or fixtures"

- id: C2
  claim: Prepopulate the database with hard-coded data when first setting up an app.
  source: S2
  evidence: "prepopulate your database with hard-coded data"

- id: C3
  claim: Create a data migration to load initial data automatically.
  source: S2
  evidence: "To automatically load initial data for an app, create a :ref:`data migration"

## Sources

- [S1] How to provide initial data for models. Django docs. https://docs.djangoproject.com/en/5.2/howto/initial-data/ . License: BSD-3-Clause. Accessed 2026-11-18.

- [S2] initial-data.txt. Django. https://raw.githubusercontent.com/django/django/stable/5.2.x/docs/howto/initial-data.txt . License: BSD-3-Clause. Accessed 2026-11-18.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
