Model Mommy: A Legacy Python Fixture Factory, Migrate to Model Bakery
This repository profile is provided by osrepos.com, an open source repository discovery platform.
Summary
Model Mommy was a popular Python library designed to simplify the creation of smart test fixtures and realistic test data. This project is no longer actively maintained, and its users are strongly advised to migrate to its successor, Model Bakery. The renaming to Model Bakery was a conscious decision to avoid reinforcing gender stereotypes within the technology community.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Model Mommy was a widely used Python library that provided a smart and efficient way to generate test fixtures for applications, particularly within the Django ecosystem. It aimed to simplify the process of creating realistic test data, making unit and integration testing more streamlined and less prone to boilerplate code.
Important Note: Model Mommy is no longer maintained. Its development has ceased, and the project has been succeeded by Model Bakery. Users of Model Mommy are strongly encouraged to migrate their projects to Model Bakery for continued support, new features, and bug fixes. The decision to rename the project to Model Bakery was made to address and avoid reinforcing gender stereotypes for women in technology, a move detailed in the project's original README.
Installation
Given that Model Mommy is deprecated, installing it for new projects is not recommended. For existing projects that still rely on it, you might have it installed. If you need to install it for legacy reasons, you can use pip:
pip install model_mommy
However, the recommended action is to migrate to Model Bakery. You can install Model Bakery using pip:
pip install model_bakery
Please refer to the Model Bakery documentation for detailed migration guides and usage instructions.
Examples
Model Mommy's core functionality revolved around intelligently creating instances of your Django models, populating their fields with sensible default data or allowing for custom overrides. For instance, it could generate a User object with a valid username and email without you having to manually specify each field.
While specific code examples for Model Mommy are now less relevant due to its deprecation, its successor, Model Bakery, offers the same powerful capabilities. Model Bakery allows you to create model instances with ease, making your tests cleaner and more robust. For example, creating a model instance might look like this with Model Bakery:
from model_bakery.bakery import make
from myapp.models import MyModel
# Create a MyModel instance with default values
instance = make(MyModel)
# Create a MyModel instance with specific field values
instance_with_data = make(MyModel, name="Test Name", value=123)
This approach significantly reduces the effort required to set up test environments.
Why Use (or Why Migrate)
Model Mommy played a significant role in the Python testing landscape by providing a robust solution for fixture generation. Its intelligent defaults and ease of use helped many developers write better, more comprehensive tests.
The primary reason to migrate from Model Mommy to Model Bakery is the active maintenance and continued development of the latter. Model Bakery is the direct successor, benefiting from ongoing community contributions, bug fixes, and compatibility updates with newer versions of Python and Django. Furthermore, the renaming reflects a commitment to fostering a more inclusive environment in tech. By migrating, you ensure your project uses a supported library and aligns with modern best practices.
Links
- Model Mommy GitHub Repository: https://github.com/berinhard/model_mommy
- Model Bakery PyPI: https://pypi.org/project/model-bakery/
- Model Bakery Migration Guide: https://model-bakery.readthedocs.io/en/latest/migrating_from_mommy.html
- Article on Gender Stereotypes in Tech: https://www.witi.com/articles/1017/How-Gender-Stereotypes-are-Still-Affecting-Women-in-Tech/
Related repositories
Similar repositories that may be relevant next.

Faker: Generate Realistic Fake Data for Your Python Projects
August 2, 2026
Faker is a powerful Python package designed to generate realistic fake data. It's an essential tool for bootstrapping databases, creating test data, filling persistence layers for stress testing, or anonymizing sensitive production data. With support for various data types and localization, Faker streamlines development and testing workflows.

pangu.py: Automated Paranoid Text Spacing for Enhanced Readability
August 1, 2026
pangu.py is a Python library designed for opinionated, "paranoid" text spacing. It automatically inserts whitespace between CJK (Chinese, Japanese, Korean) and half-width characters, such as alphabetical letters, numerical digits, and symbols. This tool significantly improves text readability by ensuring consistent and proper spacing.
pyfiglet: Render ASCII Text into ASCII Art Fonts in Python
August 1, 2026
pyfiglet is a pure Python port of the classic FIGlet utility, designed to transform ordinary ASCII text into impressive ASCII art fonts. It offers flexibility, allowing users to generate stylized text both from the command line and directly within their Python applications. This tool is ideal for adding unique visual flair to terminal outputs, banners, or creative text displays.
python-pinyin: A Robust Python Library for Hanzi to Pinyin Conversion
August 1, 2026
`python-pinyin` is a powerful Python library designed for converting Chinese characters (Hanzi) into Pinyin. It offers advanced features such as intelligent phrase matching, comprehensive support for polyphonic characters, and various Pinyin and Bopomofo output styles. This tool is essential for developers working on Chinese text processing tasks, including annotation, sorting, and search functionalities.
Source repository
Open the original repository on GitHub.