--- id: django-dynamic-fixture version: "4.0.1" license: MIT license_treatment: permissive maintenance: dormant --- # django-dynamic-fixture — A full library to create dynamic model instances for testing purposes. License: permissive · Maintenance: dormant · Downloads: 162.6K/mo ## What it is and what it does Django Dynamic Fixture (DDF) is a test-data generation library that creates Django model instances on demand, saving you from writing repetitive fixture code. Instead of manually constructing test objects with all their required fields, you call G(Model) to generate a valid instance with sensible random defaults, then override only the fields that matter for your test. It handles relationships, foreign keys, and nested object creation through a simple dot-notation syntax, and provides utilities like M() for masked random strings and teach() to define reusable generation rules. The library is designed to keep test code readable and maintainable by letting you focus on test logic rather than data setup. It works with Django's ORM directly and integrates into your existing test suite without special configuration. Use it for: - Writing unit tests for Django models where you need valid instances but don't care about most field values - Creating related objects in tests without nested fixture boilerplate - Generating multiple test instances quickly for bulk test data - Testing model methods and querysets where the test logic matters more than the data setup - Defining reusable test data patterns across a test suite using teach() to configure model generation rules ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Creates dynamic Django model instances for testing without manual fixture setup, letting you generate test data with minimal boilerplate. Yes, if you write Django tests. DDF has no runtime dependencies, low install friction, and a stable track record since its first release in 2011. The dormant maintenance status is acceptable for a mature library—it does one thing well and doesn't require frequent updates. Install it if you want to reduce test boilerplate; skip it only if your project uses minimal fixtures or a different test-data strategy. ## Install pip install django-dynamic-fixture uv add django-dynamic-fixture poetry add django-dynamic-fixture ## Installing django-dynamic-fixture Before you install: Low friction install with no runtime dependencies. Maintenance is dormant—last release was Sep 2023 and last commit Oct 2024—but the package is stable and widely used. Suitable for established projects that don't require active development. License in practice: MIT license is permissive; you can use this in commercial and open-source projects with minimal restrictions. Quickstart: pip install django-dynamic-fixture from ddf import G author = G(Author) book = G(Book, authors=[author]) Requires Django to be installed and configured in your project; DDF generates instances for Django models only. Verify before relying: - Whether the package works with Django versions released after Oct 2024 - Compatibility with Python 3.12+ (classifiers list only up to 3.11) - Monthly download volume and its stability over time ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 162.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django test fixtures, generate test data django, django model factory, dynamic test instances, django testing helpers, mock django models, django test data generation, django-testing, test-fixtures, orm-helpers [View on SkillFed](https://skillfed.io/packages/django-dynamic-fixture) · [View on PyPI](https://pypi.org/project/django-dynamic-fixture/)