Application Settings¶
SmallBlock can be configured via a YAML settings file and/or environment variables.
Order of Precedence¶
Environment variables (highest)
settings.yamlin the project rootBuilt-in defaults
Environment Variables¶
Common variables:
Variable |
Description |
|---|---|
|
Database connection string. |
|
|
|
Comma-separated hostnames (e.g., |
|
Random secret used for cryptographic signing. |
|
Filesystem path to collected static files. |
|
Filesystem path for user uploads. |
|
|
Example .env¶
DEBUG=false
ALLOWED_HOSTS=smallblockcms.com
SECRET_KEY=change-me-please
DATABASE_URL=postgresql://sb_user:secure_password@localhost/smallblock
STATIC_ROOT=/srv/smallblock/static
MEDIA_ROOT=/srv/smallblock/media
LOG_LEVEL=INFO
YAML Settings (settings.yaml)¶
debug: false
allowed_hosts:
- smallblockcms.com
database:
engine: postgresql
name: smallblock
user: sb_user
password: secure_password
host: localhost
port: 5432
paths:
static_root: /srv/smallblock/static
media_root: /srv/smallblock/media
Reloading Changes¶
For environment variables, restart the app service:
sudo systemctl restart smallblockFor YAML changes, restart as well unless hot-reload is enabled in development.