flake8-django-migrations
Source Code: https://github.com/browniebroke/flake8-django-migrations
Flake8 plugin to lint for backwards incompatible database migrations.
Installation
Install using pip (or your favourite package manager):
pip install flake8-django-migrations
Usage
This plugin should be used automatically when running flake8:
flake8
Checks
This is the list of checks currently implemented by this plugin.
DM001
RemoveField operation should be wrapped in SeparateDatabaseAndState.
Such an operation should be run in two separate steps, using SeparateDatabaseAndState, otherwise it is not backwards compatible.
- Step 1: remove the field from the model and code. For foreign key fields, the foreign key constraint should also be dropped.
- Step 2: remove the column from the database.
Bad
class Migration(migrations.Migration):
operations = [
migrations.RemoveField(
model_name="order",
name="total",
),
]
Good
class Migration(migrations.Migration):
operations = [
migrations.SeparateDatabaseAndState(
state_operations=[
migrations.RemoveField(
model_name="order",
name="total",
),
],
),
]
Release files for flake8-django-migrations 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8_django_migrations-1.3.0.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_django_migrations-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / flake8_django_migrations-1.3.0.tar.gz
| Download URL | flake8_django_migrations-1.3.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cfb6b4b51794ad4a4d7499a3698bfdaf897ef116c84887fd21e369b73edc7e12
|
|
BLAKE2b-256 checksum How to use checksums |
cfcd4427438eb5184f933d908a6ee420a0ddcd9decd7ae6e2d7e4651e5ec568b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency logRelease files / flake8_django_migrations-1.3.0-py3-none-any.whl
| Download URL | flake8_django_migrations-1.3.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a2bebf94efdee7751b92dc8a46cf4072a2d3f4941ee9a63337aedee05870fd2
|
|
BLAKE2b-256 checksum How to use checksums |
f24ca8bb96729c2511ebf0aafb3c09da39f3fdd5bcc6bce1ca10bde2049e6e11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency log