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

forge-work

A single command to run everything you need for local Django development.

Forge work command example

The following processes will run simultaneously (some will only run if they are detected as available):

Installation

Django + Forge Quickstart

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

Install for existing Django projects

First, install forge-work from PyPI:

pip install forge-work

Then add it to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    ...
    "forgework",
]

Now instead of using the basic manage.py runserver (and a bunch of commands before and during that process), you can simply do:

python manage.py work

Development processes

Runserver

The key process here is still manage.py runserver. But, before that runs, it will also wait for the database to be available and run manage.py migrate.

forge-db

If forge-db is installed, it will automatically start and show the logs of the running database container.

forge-tailwind

If forge-tailwind is installed, it will automatically run the Tailwind compile --watch process.

package.json

If a package.json file is found and contains a watch script, it will automatically run. This is an easy place to run your own custom JavaScript watch process.

Stripe

If a STRIPE_WEBHOOK_PATH env variable is set then this will add a STRIPE_WEBHOOK_SECRET to .env (using stripe listen --print-secret) and it will then run stripe listen --forward-to <runserver:port/stripe-webhook-path>.

Ngrok

If an NGROK_SUBDOMAIN env variable is set then this will run ngrok http <runserver_port> --subdomain <subdomain>. Note that ngrok will need to be installed on your system already (however you prefer to do that).