--- id: flake8-django version: "1.4" license: GPL-3.0-or-later license_treatment: copyleft maintenance: dormant --- # flake8-django — Plugin to catch bad style specific to Django Projects. License: copyleft · Maintenance: dormant · Downloads: 87.6K/mo ## What it is and what it does flake8-django is a linter plugin that integrates Django-specific style checks into the flake8 framework. It enforces a set of rules designed to catch common Django anti-patterns and style violations—for example, flagging null=True on string fields, discouraging locals() in render contexts, and ensuring models define __str__ methods. The plugin works by analyzing your Django code's abstract syntax tree using astroid, then reporting violations as flake8 errors. You install it alongside flake8, then run flake8 normally; it automatically applies its Django rules to your codebase. Seven rules are enabled by default (DJ01, DJ03, DJ06, DJ07, DJ08, DJ12, DJ13), and two optional rules (DJ10, DJ11) can be enabled via flake8 configuration. It's intended for teams enforcing Django style consistency across a project. Use it for: - Enforce consistent Django model field definitions across a team by catching null=True on CharField/TextField. - Catch ModelForm misconfigurations (exclude vs. fields, __all__ usage) during code review. - Ensure all Django models define __str__ methods for better debugging and admin interface display. - Validate that @receiver decorators are placed correctly at the top of other decorators. - Enforce Django Style Guide compliance for model inner class and method ordering. - Integrate Django linting into CI/CD pipelines to catch style violations before merge. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A flake8 plugin that detects Django-specific code style violations and anti-patterns in Django projects, enforcing rules like proper null handling on model fields, correct ModelForm configuration, and model method definitions. Yes, with conditions. Install if you maintain a Django project and want automated enforcement of Django-specific style rules integrated into flake8. The plugin is stable and has no known vulnerabilities, but maintenance is dormant; verify that its rules remain compatible with your Django version before adopting. The copyleft GPL-3.0-or-later license requires compliance if you redistribute or modify the plugin itself, but using it as a development tool typically poses no constraint. ## Install pip install flake8-django uv add flake8-django poetry add flake8-django ## Installing flake8-django Before you install: High install friction due to two runtime dependencies. Maintenance is dormant—last release was 2023-07-31, though the repository remains unarchived with 180 stars. License in practice: Licensed under GPL-3.0-or-later (copyleft). Any project using this plugin must comply with GPLv3+ terms; proprietary or closed-source projects may face licensing constraints. Quickstart: pip install flake8-django Then run flake8 on your Django project: flake8 --select=E,F,W,C90,DJ your_django_app/ Or enable optional rules like DJ10: flake8 --select=E,F,W,C90,DJ,DJ10 your_django_app/ Requires flake8 and astroid as runtime dependencies; requires Python >=3.7.2,<4.0.0. Verify before relying: - Whether dormant maintenance status affects compatibility with recent Django versions. - Whether all seven core rules (DJ01, DJ03, DJ06, DJ07, DJ08, DJ12, DJ13) and two optional rules (DJ10, DJ11) remain effective for current Django codebases. ## Package facts - License: GPL-3.0-or-later (copyleft) - Python support: supports_current - Install friction: high - Maintenance: dormant - Downloads: 87.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django code style linter, flake8 django plugin, django model field validation, django best practices checker, django anti-pattern detection, django code quality, django linting rules, django-linting, flake8-plugin, code-style [View on SkillFed](https://skillfed.io/packages/flake8-django) · [View on PyPI](https://pypi.org/project/flake8-django/)