Skip to main content

django-data-seed

CI PyPI version Python versions Django versions License: MIT

Fill your entire Django database with realistic, valid test data — in one command, with zero configuration.

Every Django project hits the same wall: you need data to build against. So you click through the admin for twenty minutes, or hand-write fixtures, or maintain a factory for every single model — and you still end up with test test and a@a.com everywhere, which makes demos look fake and lets real bugs hide.

django-data-seed does it for you. Point it at your project and it reads your models, works out the right order to fill them, generates believable data that respects every field's rules, and bulk-inserts the lot — in seconds.

pip install django-data-seed
python manage.py seeddata --count 20 --seed 42
Pre-flight
  ✔ Database: postgresql (JSON ✓, bulk-returns-pk ✓)
  ✔ Migrations: all applied
  ✔ Schema: 14 models in sync
Seed plan — 20 rows per model
├── shop.Author
├── shop.Publisher
└── shop.Book
✨ 280 rows across 14 models in 0.4s (seed 42)

That's the whole thing. No factories, no fixtures, no configuration.


Features

Feature What it does for you
Zero-config generation Reads your models and fills every field type with a valid value — nothing to write.
Realistic values A column named city gets a real city, email a real address, price a believable amount — not lorem ipsum.
Correct relationships Seeds parents before children and reuses existing rows, instead of creating a fresh parent for every child.
Coherent rows A row makes sense with itself: created ≤ updated ≤ shipped dates, one person behind the name/email, one place behind the city/zip.
Reliable uniqueness Honours unique and unique_together / UniqueConstraint without hitting duplicate errors.
Pre-flight safety Refuses to run against a stale schema — it flags unapplied migrations or model drift before writing a row.
Bulk speed bulk_create, batched — a hundred thousand rows in seconds.
Reproducible --seed 42 produces the exact same data every run — for teammates, CI, and bug reports.
CLI and Python API Watch it run in the terminal, or call seed() from your scripts and tests.

Supported versions

Supported
Python 3.10, 3.11, 3.12, 3.13, 3.14
Django 4.0 → 6.0 (every release, including the 4.2 and 5.2 LTS)
Databases SQLite, PostgreSQL, MySQL / MariaDB, SQL Server

Every push is tested on GitHub Actions across Python 3.10–3.13 × Django 4.0–5.2 on SQLite, PostgreSQL, and MySQL — the CI badge above is the live proof.

Dependencies

Installing the package pulls in just three small runtime dependencies:

Package Why it's needed
Django >= 4.0 The framework the app plugs into.
mimesis >= 11 Generates the fake data — fast and locale-aware.
rich >= 13 Draws the progress bars and summary tables in the CLI.

Database drivers are optional extras, so you only install what you use:

pip install django-data-seed              # core — SQLite works out of the box
pip install django-data-seed[postgres]    # PostgreSQL (psycopg)
pip install django-data-seed[mysql]       # MySQL & MariaDB (mysqlclient)

How to configure it in your project

Three steps — that's the entire setup.

1. Install

pip install django-data-seed

2. Add it to INSTALLED_APPS

# settings.py
INSTALLED_APPS = [
    # ...
    "django_data_seed",
]

3. Seed

python manage.py seeddata --count 20 --seed 42

Using it

python manage.py seeddata                      # every model, 10 rows each
python manage.py seeddata shop.Book --count 50 # just one model
python manage.py seeddata --dry-run            # preview the plan, write nothing
python manage.py seeddata --locale de_DE       # localised data

Or from Python — handy in scripts and tests:

from django_data_seed import seed

seed("shop.Book", count=50, seed=42)   # reproducible
seed(count=25)                         # the whole project

📖 Full documentation

The README is the quick tour. For the complete guide — every CLI flag, the Python API, how foreign-key strategies and coherence work, custom overrides, and the 0.4 → 1.0 migration notes — see the docs:


License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

Support

For any issues or questions, open an issue on the GitHub repository.

Author

Rohith Baggam

LinkedIn · GitHub

Metadata

Release files for django-data-seed 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-data-seed 1.0.1
File Size Uploaded Provenance Actions
django_data_seed-1.0.1.tar.gz 54.3 kB Without provenance Details for django_data_seed-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-data-seed 1.0.1
File Interpreter ABI Platform Actions
django_data_seed-1.0.1-py3-none-any.whl Python 3 none any Details for django_data_seed-1.0.1-py3-none-any.whl

Total release size: 106.4 kB

Release files / django_data_seed-1.0.1.tar.gz

Download URL django_data_seed-1.0.1.tar.gz
Size 54.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f57b470d8549d403c503ecdcd561241edb0efb13f9b252869b0f898bc24a3262
BLAKE2b-256 checksum
How to use checksums
f6e77eff4e8bc11561033a9cc441c113780e9472adfbc5d50177d17a4476adb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / django_data_seed-1.0.1-py3-none-any.whl

Download URL django_data_seed-1.0.1-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84aaffd1b78bf1170b346f5ccee76f2ed51d789264038cf8a8a6e8924b64df0b
BLAKE2b-256 checksum
How to use checksums
c2570f47bd2d68e79c1c871cac6109b22f886f7a3e5bc514df02e03b369b8e68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for django-data-seed 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page