django-fixture-magic
A few extra management tools to handle fixtures.
What it is and what it does
django-fixture-magic extends Django's management commands with tools for exporting database state as JSON fixtures. It addresses the common problem of generating test data that respects foreign-key relationships: when you dump a Book object, it automatically includes its related Author, preventing foreign-key errors when loading fixtures into a fresh database. The package provides four commands: dump_object (export objects and their dependencies), merge_fixtures (deduplicate across multiple fixture files), reorder_fixtures (reorder models to satisfy load order), and custom_dump (export complex multi-dependent object graphs via configuration).
The package has no runtime dependencies and installs as a pure Python wheel. However, it is dormant—the latest release dates to 2020-07-15 and targets Django 1.8–2.1 and Python 2.7/3.6. Users on modern versions should verify compatibility before adopting.
Use it for:
- Generate test fixtures from database snapshots while automatically including all related objects via foreign keys.
- Combine multiple partial fixture files into a single deduplicated fixture for test setup.
- Reorder fixture objects to load in dependency order, avoiding foreign-key constraint violations during test initialization.
- Export complex multi-model object graphs via a single custom_dump command configured with dependents and ordering rules.
- Automate fixture generation in test pipelines to keep test data synchronized with schema changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Django management commands to dump database objects with their foreign-key dependencies into JSON fixtures, merge multiple fixtures, and reorder fixtures to resolve foreign-key load errors.
No, unless you are maintaining a legacy Django 1.8–2.1 project on Python 2.7 or 3.6. The package is dormant and compatibility with modern Django and Python versions is unverified. For current projects, consider modern alternatives or Django's built-in dumpdata/loaddata with custom logic.
Install
django-fixture-magic on PyPI
pip
pip install django-fixture-magicuv
uv add django-fixture-magicpoetry
poetry add django-fixture-magicInstalling django-fixture-magic
Before you install
Low install friction with no runtime dependencies. Package is dormant (last release 2020-07-15, last commit 2023-10-26) and targets Django 1.8–2.1 and Python 2.7/3.6, making it potentially incompatible with modern versions.
License in practice
BSD license is permissive and poses no restrictions on use, modification, or distribution.
Quickstart
pip install django-fixture-magic
Add to INSTALLED_APPS in settings.py:
'fixture_magic',
Then run:
./manage.py dump_object APP.MODEL PK1 PK2 > my_fixture.json
Requires Django 1.8–2.1 and Python 2.7 or 3.6; compatibility with modern versions unverified.
Verify before relying
- Whether the package works with Django versions beyond 2.1
- Whether the package is compatible with Python versions beyond 3.6
- Current maintenance status and whether dormancy indicates abandonment or stable maturity
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 2,221 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 96,577/month — #13,206 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_fixture_magic-0.1.5-py2-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fixturesProvides a reusable fixture contract for unit…
permissive · top 15,000 on PyPI
pytest-lazy-fixturesAllows you to reference pytest fixtures…
permissive · top 5,000 on PyPI
django-cities-lightProvides Django models and management commands…
permissive · top 15,000 on PyPI
pytest-postgresqlA pytest plugin that provides fixtures to…
copyleft · top 5,000 on PyPI
pytest-deadfixturesA pytest plugin that identifies unused and…
permissive · top 5,000 on PyPI
pytest-factoryboyIntegrates factory_boy with pytest to register…
permissive · top 5,000 on PyPI
model-bakeryModel Bakery creates test fixtures for Django…
permissive · top 5,000 on PyPI
mock-alchemyProvides mock helpers for SQLAlchemy sessions…
permissive · top 15,000 on PyPI
pytest-unused-fixturesA pytest plugin that identifies and reports…
permissive · top 15,000 on PyPI
pytest-lazy-fixtureAllows you to use pytest fixtures directly as…
permissive · top 15,000 on PyPI