Django integration for the Bella Baxter secret management SDK
Project description
bella-baxter-django
Django integration for the Bella Baxter secrets management platform. Automatically loads secrets from Bella Baxter and makes them available throughout your Django app.
Installation
pip install bella-baxter-django
Quickstart
# settings.py
INSTALLED_APPS = [
...
'bella_baxter_django',
]
BELLA_BAXTER_API_KEY = 'bax-...'
BELLA_BAXTER_URL = 'https://api.bella-baxter.io' # optional, this is the default
# anywhere in your code
from bella_baxter_django import get_bella
client = get_bella()
secrets = client.get_all_secrets()
db_url = secrets.secrets['DATABASE_URL']
How it works
get_bella() returns a shared BaxterClient instance, initialised lazily on first call
and cached for the lifetime of the process. Adding 'bella_baxter_django' to INSTALLED_APPS
triggers eager initialisation at Django startup via BellaBaxterConfig.ready(),
so the first request doesn't bear the connection cost.
Configuration
| Setting | Required | Default | Description |
|---|---|---|---|
BELLA_BAXTER_API_KEY |
✅ | — | API key (bax-...) |
BELLA_BAXTER_URL |
❌ | https://api.bella-baxter.io |
Base URL of the Baxter API |
Using secrets in views
from django.http import JsonResponse
from bella_baxter_django import get_bella
def health(request):
bella = get_bella()
secrets = bella.get_all_secrets()
return JsonResponse({'db': secrets.secrets.get('DATABASE_URL', 'not set')})
Using secrets in settings.py
# settings.py — bootstrap secrets before Django fully loads
import os
from bella_baxter import BaxterClient, BaxterClientOptions
_bella = BaxterClient(BaxterClientOptions(
baxter_url=os.environ.get('BELLA_BAXTER_URL', 'https://api.bella-baxter.io'),
api_key=os.environ['BELLA_BAXTER_API_KEY'],
))
_secrets = _bella.get_all_secrets().secrets
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'HOST': _secrets['DB_HOST'],
'NAME': _secrets['DB_NAME'],
'USER': _secrets['DB_USER'],
'PASSWORD': _secrets['DB_PASSWORD'],
}
}
Authentication
Generate an API key via the CLI or the Bella WebApp:
bella api-keys create --env production --name "Django Production"
Set it in your environment and reference it in settings.py:
export BELLA_BAXTER_API_KEY="bax-..."
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 bella_baxter_django-0.1.1rc41.tar.gz.
File metadata
- Download URL: bella_baxter_django-0.1.1rc41.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b6a811a81bc0f6fa1d3b446e48c1a8fc1b0d0717e5f6ac2a4bf932944bf1d8
|
|
| MD5 |
7a078b688f9d61a3d8650b4a5a1ace93
|
|
| BLAKE2b-256 |
63585eaa236d338e76db3756e11d8a470638dc8a27f25eab94c5a75cf7f44329
|
Provenance
The following attestation bundles were made for bella_baxter_django-0.1.1rc41.tar.gz:
Publisher:
publish.yml on Cosmic-Chimps/bella-baxter-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bella_baxter_django-0.1.1rc41.tar.gz -
Subject digest:
58b6a811a81bc0f6fa1d3b446e48c1a8fc1b0d0717e5f6ac2a4bf932944bf1d8 - Sigstore transparency entry: 1249830532
- Sigstore integration time:
-
Permalink:
Cosmic-Chimps/bella-baxter-python@813d71c1ceae8c9795e0cf8fee5cb71d224cd1eb -
Branch / Tag:
refs/tags/v0.1.1-preview.41 - Owner: https://github.com/Cosmic-Chimps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@813d71c1ceae8c9795e0cf8fee5cb71d224cd1eb -
Trigger Event:
push
-
Statement type:
File details
Details for the file bella_baxter_django-0.1.1rc41-py3-none-any.whl.
File metadata
- Download URL: bella_baxter_django-0.1.1rc41-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80d5f0eaafa23cf20ad3001210b8dc8ba39f610b07dbc4f407571a3b2c6feec2
|
|
| MD5 |
dfe019e0762accf65dce13d775e89612
|
|
| BLAKE2b-256 |
587c4d4317606c289457106c2304cbb8e1098ed2554d8a2ee3cf4c6cd8e6cb3f
|
Provenance
The following attestation bundles were made for bella_baxter_django-0.1.1rc41-py3-none-any.whl:
Publisher:
publish.yml on Cosmic-Chimps/bella-baxter-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bella_baxter_django-0.1.1rc41-py3-none-any.whl -
Subject digest:
80d5f0eaafa23cf20ad3001210b8dc8ba39f610b07dbc4f407571a3b2c6feec2 - Sigstore transparency entry: 1249830539
- Sigstore integration time:
-
Permalink:
Cosmic-Chimps/bella-baxter-python@813d71c1ceae8c9795e0cf8fee5cb71d224cd1eb -
Branch / Tag:
refs/tags/v0.1.1-preview.41 - Owner: https://github.com/Cosmic-Chimps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@813d71c1ceae8c9795e0cf8fee5cb71d224cd1eb -
Trigger Event:
push
-
Statement type: