Work library for Forge
Project description
forge-work
A single command to run everything you need for Django development at once.
The following processes will run simultaneously (some will only run if they are detected as available):
manage.py runserver
(and migrations)forge-db start --logs
forge-tailwind compile --watch
npm run watch
stripe listen --forward-to
ngrok http --subdomain
Installation
Forge installation
The forge-work
package is a dependency of forge
and is available as forge work
.
If you use the Forge quickstart, everything you need will already be set up.
The standard Django installation can give you an idea of the steps involved.
Standard Django installation
This package can be used without forge
by installing it as a regular Django app.
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
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
The forge-db
package uses Docker to run a local Postgres database.
If forge-db
is installed, it will automatically start and show the logs of the running database container.
forge-tailwind
The forge-tailwind
package compiles Tailwind CSS using the Tailwind standalone CLI.
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>
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for forge_work-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb4e4025e1870ababa5e48e778c6bff47ddbfc40aa880554a2e437192b8fc199 |
|
MD5 | 94737d62d20368956dcd8d403bf271d2 |
|
BLAKE2b-256 | 5e8f8546395e185390fd677962ccddb58fd1f9401e4ccdd4dc337127341075e0 |