Configuration
You can configure byro in two different ways: using configuration files or environment variables. You can combine those two options, and their precedence is in this order:
Environment variables
- Configuration files
The configuration file in the environment variable
BYRO_CONFIG_FILEif present, or:- The following three configuration files in this order:
The configuration file
byro.cfgin thesrcdirectory, next to thebyro.example.cfgfile.The configuration file
~/.byro.cfgin the home of the executing user.The configuration file
/etc/byro/byro.cfg
Sensible defaults
This page explains the options by configuration file section and notes the corresponding environment variable next to it. A configuration file looks like this:
[filesystem]
data = /var/byro/data
media = /var/byro/data/media
logs = /var/byro/data/logs
[locale]
language_code = de
[site]
debug = False
url = https://byro.mydomain.com
[database]
name = byro
user = byro
password = byro
host = localhost
port = 5432
engine = postgresql
[mail]
from = admin@localhost
host = localhost
port = 25
user = admin
password = something
tls = False
ssl = True
The filesystem section
data
The
dataoption describes the path that is the base for the media files directory, and where byro will save log files. Unless you have a compelling reason to keep those files apart, setting thedataoption is the easiest way to configure byro.Environment variable:
BYRO_DATA_DIRDefault: A directory called
datanext to byro’smanage.py.
media
The
mediaoption sets the media directory that contains user generated files. It needs to be writeable by the byro process.Environment variable:
BYRO_FILESYSTEM_MEDIADefault: A directory called
mediain thedatadirectory (see above).
logs
The
logsoption sets the log directory that contains logged data. It needs to be writeable by the byro process.Environment variable:
BYRO_FILESYSTEM_LOGSDefault: A directory called
logsin thedatadirectory (see above).
static
The
staticsoption sets the directory that contains static files. It needs to be writeable by the byro process. byro will put files there during thecollectstaticcommand.Environment variable:
BYRO_FILESYSTEM_STATICDefault: A directory called
static.distnext to byro’smanage.py.
The site section
debug
Decides if byro runs in debug mode. Please use this mode for development and debugging, not for live usage.
Environment variable:
BYRO_DEBUGDefault:
Trueif you’re executingrunserver,Falseotherwise. Never run a production server in debug mode.
url
This value will appear wherever byro needs to render full URLs (for example in emails and), and set the appropriate allowed hosts variables.
Environment variable:
BYRO_SITE_URLDefault:
http://localhost
secret
Every Django application has a secret that Django uses for cryptographic signing. You do not need to set this variable – byro will generate a secret key and save it in a local file if you do not set it manually.
Default: None
The database section
name
The database’s name.
Environment variable:
BYRO_DB_NAMEDefault:
''
user
The database user.
Environment variable:
BYRO_DB_USERDefault:
''
password
The database password.
Environment variable:
BYRO_DB_PASSDefault:
''
host
The database host, or the socket location, as needed.
Environment variable:
BYRO_DB_HOSTDefault:
''
port
The database port.
Environment variable:
BYRO_DB_PORTDefault:
''
engine
The database engine.
Environment variable:
BYRO_DB_ENGINEDefault:
'postgresql'– by default it falls back to the PostgreSQL backendPossible values:
postgresql,mysql,sqlite3,oracle
The mail section
from
The fall-back sender address, e.g. for when byro sends event independent emails.
Environment variable:
BYRO_MAIL_FROMDefault:
admin@localhost
host
The email server host address.
Environment variable:
BYRO_MAIL_HOSTDefault:
localhost
port
The email server port.
Environment variable:
BYRO_MAIL_PORTDefault:
25
user
The user account for mail server authentication, if needed.
Environment variable:
BYRO_MAIL_USERDefault:
''
password
The password for mail server authentication, if needed.
Environment variable:
BYRO_MAIL_PASSWORDDefault:
''
tls
Should byro use TLS when sending mail? Please choose either TLS or SSL.
Environment variable:
BYRO_MAIL_TLSDefault:
False
ssl
Should byro use SSL when sending mail? Please choose either TLS or SSL.
Environment variable:
BYRO_MAIL_SSLDefault:
False
The logging section
email
The email address (or addresses, comma separated) to send system logs to.
Environment variable:
BYRO_LOGGING_EMAILDefault:
''
email_level
The log level to start sending emails at. Any of
[DEBUG, INFO, WARNING, ERROR, CRITICAL].Environment variable:
BYRO_LOGGING_EMAIL_LEVELDefault:
'ERROR'
The locale section
language_code
The system’s default locale.
Environment variable:
BYRO_LANGUAGE_CODEDefault:
'de'
time_zone
The system’s default time zone as a
pytzname.Environment variable:
BYRO_TIME_ZONEDefault:
'UTC'