django-add-default-value
This django Migration Operation can be used to transfer a fields default value to the database scheme.
What it is and what it does
django-add-default-value is a Django migration operation that lets you set default values at the database level when adding new fields to existing tables. Instead of relying on Django's ORM default (which only applies to new rows created through Django), this operation runs a SQL ALTER TABLE statement to set the default in the schema itself, ensuring backward compatibility and consistency across all database access patterns.
You use it by adding an AddDefaultValue operation to your migration file after the AddField operation. It supports MySQL, PostgreSQL, CockroachDB, and MSSQL. The package has been dormant since early 2022, so while it remains functional for the Django versions it was tested against, there is no active maintenance or support for newer Django releases.
Use it for:
- Adding a required field with a default value to an existing Django model without breaking existing code or database queries
- Ensuring database-level consistency when a field default must apply to all rows, not just those created through Django ORM
- Migrating legacy schemas where the database itself needs to enforce default values independent of application logic
- Handling backward compatibility in production deployments where you need to add a column with a safe default without downtime
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Django migration operation to set database-level default values for fields, enabling backward-compatible schema changes when adding new columns with defaults to existing tables.
Yes, if you are on Django 1.11–3.2 and need to set database-level defaults during migrations. No, if you are on a newer Django version—the package is dormant and has not been tested or updated for Django 4.0+. Check your Django version against the classifiers before installing.
Install
django-add-default-value on PyPI
pip
pip install django-add-default-valueuv
uv add django-add-default-valuepoetry
poetry add django-add-default-valueInstalling django-add-default-value
Before you install
Low install friction with a single Django dependency. Maintenance is dormant—last release was 2022-02-02 and no commits since 2024-03-20—so expect no active support or updates for newer Django versions.
License in practice
Released under Apache 2.0 (permissive), so you can use, modify, and distribute it freely in commercial and private projects without restriction.
Quickstart
pip install django-add-default-value
In your migration file:
from django_add_default_value import AddDefaultValue
operations = [
migrations.AddField(...),
AddDefaultValue(
model_name='my_model',
name='my_field',
value='my_default'
)
]
Verify before relying
- Whether the package works with Django versions released after 2022 (classifiers list only up to 3.2)
- Current test coverage and whether MSSQL support has been validated since the 'currently not tested' note
Package facts
| License | Apache-2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Django |
| Maintenance | dormant — 1,654 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 326,397/month — #7,577 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_add_default_value-0.10.0-py3-none-any.whl
Keywords: django, migration, default, database backward compatibility
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
django-deprecate-fieldsProvides a decorator to mark Django model…
permissive · top 5,000 on PyPI
django-syzygyAutomates Django database migration deployment…
permissive · top 15,000 on PyPI
django-safemigrateAdds a safemigrate command to Django that…
permissive · top 15,000 on PyPI
django-concurrencyAdds optimistic locking to Django models to…
permissive · top 15,000 on PyPI
django-citextProvides PostgreSQL CIText field types for…
permissive · top 15,000 on PyPI
django-migration-linterAnalyzes Django migrations to detect…
permissive · top 5,000 on PyPI
django-soft-deleteAdds soft deletion to Django models by marking…
permissive · top 15,000 on PyPI
django-sequencesProvides gapless sequence generation for Django…
permissive · top 15,000 on PyPI
django-linear-migrationsEnforces linear migration history in Django…
permissive · top 5,000 on PyPI
swapperSwapper provides an API for Django's…
permissive · top 15,000 on PyPI