Forge CLI
Forge comes with a set of commands to facilitate working on your Django project as well as deploying it.
When in doubt, run forge --help
to see a list of available commands and forge <command> --help
to see a full list of arguments and options.
This page is just intended to give a quick overview of what's available!
Working locally
forge work
Runs everything you need to work locally:
- The Django
runserver
- A Tailwind CSS compiler
- Postgres via Docker
forge test
Uses pytest to run your tests.
forge format
Invokes black and isort to format your Python code.
forge django <subcommand>
Passes through to the standard Django manage.py
.
For example, forge django makemigrations
.
Deployment
forge serve
Starts a gunicorn process and is intended to be used in your Heroku Procfile
.
forge pre-deploy
Runs the Django system checks and also runs database migrations during the Heroku release phase.
Quickstart
forge quickstart template
Copies the default project structure into the current directory (except for .gitignore
and pyproject.toml
).
This is used by the quickstart but can also be used manually in advanced cases.
forge quickstart heroku
Creates a Heroku app and configures buildpackes, database, and environment variables.
Utilities
forge pre-commit
Runs a set of pre-commit checks (including tests and formatting checks) and is automatically installed as a git hook during the quickstart.
When you (or a team member) clones an existing project,
forge pre-commit --install
will be run automatically as part of the ./scripts/install
script.
Tailwind
forge tailwind compile
Automatically installs/updates Tailwind and compiles app/static/src/tailwind.css
to app/static/dist/tailwind.css
.
The --watch
flag will watch for changes and automatically recompile.
The --minify
flag will minify the CSS.
The forge tailwind compile --watch
command is run automatically as a part of forge work
.
forge tailwind update
Checks for and installs the latest version of Tailwind.
The installed version is saved (i.e. "locked") in tailwind.config.js
as const FORGE_TAILWIND_VERSION = "<version>"
.