Django + Bun deployment platform
Project description
djb - Django + Bun Platform
djb is a deployment platform for Django applications with modern frontend tooling (Bun). It provides utilities for secrets management, deployment, and development workflows.
Architecture
djb is organized as a Python package within the beachresort25 project:
djb/
├── __init__.py # Package initialization
├── secrets/ # Encrypted secrets management
│ ├── __init__.py # Public API exports
│ └── core.py # Encryption/decryption implementation
└── cli/ # Command-line interface
├── __init__.py
├── djb.py # Main CLI entry point
├── init.py # Environment initialization
├── secrets.py # Secrets management
└── deploy.py # Heroku deployment
Features
Initialization
One-command setup for development environment:
# Full initialization
djb init
# Initialize with options
djb init --skip-brew # Skip Homebrew dependencies
djb init --skip-frontend # Skip frontend setup
djb init --skip-secrets # Skip secrets initialization
djb init --project-root /path # Specify project directory
This installs:
- System dependencies via Homebrew (age, PostgreSQL, GDAL, Bun)
- Python dependencies (
uv sync) - Frontend dependencies (
bun install) - Encrypted secrets management
Secrets Management
Age-style encrypted secrets for secure configuration:
# Initialize secrets
djb secrets init
# Edit environment secrets
djb secrets edit dev
djb secrets edit production
# View secrets
djb secrets view dev
djb secrets list
Documentation: See docs/SECRETS_GUIDE.md
Deployment
Heroku deployment with frontend builds, secrets sync, and migrations:
# Deploy to Heroku
djb deploy heroku --app myapp
# Deploy with options
djb deploy heroku --app myapp --skip-build --skip-secrets
# Revert to previous deployment
djb deploy revert --app myapp
# Revert to specific commit
djb deploy revert --app myapp abc1234
Usage
Command Line
djb provides two CLI interfaces:
- Direct:
djb <command> - Via beachresort:
br <command>(convenience wrapper)
Both are equivalent. The beachresort CLI delegates to djb internally.
Python API
Import djb modules directly in Python code:
from djb.secrets import load_secrets, AgeKey, SecretsManager
# Load secrets for current environment
secrets = load_secrets()
api_key = secrets['api_keys']['stripe']
# Encrypt/decrypt programmatically
key = AgeKey.generate()
manager = SecretsManager(secrets_dir=Path('secrets'), age_key=key)
manager.save_secrets('dev', data, [key.to_public_string()], encrypt=True)
Installation
djb is included in the beachresort25 project. After cloning:
# One-command setup (installs all dependencies)
djb init
# Or install manually
uv sync
# Verify djb is available
djb --help
Development
Adding New Commands
- Create a new subcommand module in
djb/cli/ - Define your Click command group
- Register it in
djb/cli/djb.py:
from djb.cli.mycommand import mycommand
djb_cli.add_command(mycommand)
Adding New Features
- Implement the feature in an appropriate module under
djb/ - Export public API in
djb/__init__.pyif needed - Add CLI commands if applicable
- Update documentation
Architecture Decisions
Why djb is in beachresort25
djb started as a separate project but has been integrated into beachresort25 to:
- Simplify dependency management
- Allow rapid iteration on both the platform and application
- Enable project-specific customization
- Avoid version conflicts between djb and application dependencies
The original external djb project will be deprecated in favor of this integrated approach.
Why Age Encryption
- Modern cryptography: X25519 + ChaCha20-Poly1305
- Simple key management: Single key file vs PGP keyring complexity
- Git-safe: Encrypted values can be committed
- Future-proof: Compatible with Kubernetes sealed secrets
Future Plans
Planned djb features:
- Environment initialization -
djb init - Deployment commands (Heroku) -
djb deploy heroku,djb deploy revert - Deployment commands (Kubernetes)
- Development server management
- Database migration utilities
- Multi-recipient secret encryption
- Secret rotation automation
- Environment variable syncing
References
- Secrets Guide - User guide for secrets management
- Age Encryption - Encryption specification
- Click - CLI framework
License
djb is licensed under the MIT License.
Mascot Attribution
The djb mascot (dj_bun) was created for this project and is distributed under CC BY-SA 4.0.
/dj_bun: playin' dev and deploy since 1984 🎶
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djb-0.2.6.tar.gz.
File metadata
- Download URL: djb-0.2.6.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffb70cf64a773e94ba2ef80fe4dd3461fec7fd7bd1026b7e5f0924301bbd653e
|
|
| MD5 |
f4887e310736c43d21ef91175067c545
|
|
| BLAKE2b-256 |
5afa33683ee720c31a206f76bf75625166d4d64bab5e00f66b67da060a3d62e3
|
Provenance
The following attestation bundles were made for djb-0.2.6.tar.gz:
Publisher:
publish.yaml on kajicom/djb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
djb-0.2.6.tar.gz -
Subject digest:
ffb70cf64a773e94ba2ef80fe4dd3461fec7fd7bd1026b7e5f0924301bbd653e - Sigstore transparency entry: 759999185
- Sigstore integration time:
-
Permalink:
kajicom/djb@abecb6d6905ba750aad653653dbdaa5c1cd35997 -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/kajicom
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@abecb6d6905ba750aad653653dbdaa5c1cd35997 -
Trigger Event:
push
-
Statement type:
File details
Details for the file djb-0.2.6-py3-none-any.whl.
File metadata
- Download URL: djb-0.2.6-py3-none-any.whl
- Upload date:
- Size: 39.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f7c09bf6281c66f85b6382b06e8f7fb280d17a8a6ba19dbfd3ec07610968065
|
|
| MD5 |
3e547c11d8df4d850f149b8facd010a9
|
|
| BLAKE2b-256 |
1167d65002a17ada4de4f3990982fbadaefac66dfa82ef9eb89294ad6e0a6c4e
|
Provenance
The following attestation bundles were made for djb-0.2.6-py3-none-any.whl:
Publisher:
publish.yaml on kajicom/djb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
djb-0.2.6-py3-none-any.whl -
Subject digest:
1f7c09bf6281c66f85b6382b06e8f7fb280d17a8a6ba19dbfd3ec07610968065 - Sigstore transparency entry: 759999192
- Sigstore integration time:
-
Permalink:
kajicom/djb@abecb6d6905ba750aad653653dbdaa5c1cd35997 -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/kajicom
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@abecb6d6905ba750aad653653dbdaa5c1cd35997 -
Trigger Event:
push
-
Statement type: