These docs are a work-in-progress and are currently undergoing a major rewrite!

forge-format

A unified, opinionated code formatting command for Django projects.

Uses black and isort to format Python code.

Installation

Django + Forge Quickstart

If you use the Forge Quickstart, everything you need will be ready and available as forge format.

Install for existing Django projects

First, install forge-format from PyPI:

pip install forge-format

Then add it to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    ...
    "forgeformat",
]

Now you will have access to the format command:

python manage.py format