To lint:
uv run ruff check
uv run ruff check --fix
We use uv to manage dependencies declared in pyproject.toml (see [project] and [dependency-groups]).
Common commands:
# Add or remove dependencies
uv add <package>
uv remove <package>
# Update locked versions and install
uv lock -U
uv sync --all-groups
See the Deployment document for an overview on steps required to deploy a BōcPress instance.
To reload the gunicorn process:
sudo systemctl reload bocpress
To reload Caddy:
systemctl restart caddy # root only
gunicorn logs:
journalctl -fb -u bocpress
Caddy logs:
journalctl -fb -u caddy
Get an overview with systemd status:
systemctl status caddy
systemctl status bocpress
See Database Backup for details. In summary:
To create a database dump:
pg_dump -Fc --no-acl bocpress -h localhost -U bocpress -f /home/deploy/bocpress.dump -w
To restore a database dump:
pg_restore -v -h localhost -cO --if-exists -d bocpress -U bocpress -W bocpress.dump
In addition to the standard Django management commands, there are also:
processnotifications: sends notification emails for new blog posts of existing records.mailexports: emails users of their blog exports.They are triggered using the standard manage.py Django way; eg:
python manage.py processnotifications
One can deploy BōcPress without setting up billing functionalities. This is the default case. To handle payments and subscriptions this project uses Stripe. To enable Stripe and payments, one needs to have a Stripe account with a single Product (eg. "BōcPress Premium Plan").
To configure, add the following variables from your Stripe account to your
.envrc:
export STRIPE_API_KEY="sk_test_XXX"
export STRIPE_PUBLIC_KEY="pk_test_XXX"
export STRIPE_PRICE_ID="price_XXX"
Copyright Mataroa & BōcPress Contributors
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3.
Forked from Mataroa