Skip to content

Commit

Permalink
Use toml and env vars for config
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasjuhrich committed May 20, 2024
1 parent f51c436 commit f8a581f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/server_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import sys
import time
import tomllib

from babel.support import Translations
from flask import g, request
Expand Down Expand Up @@ -38,8 +39,8 @@ def prepare_server(echo=False) -> PycroftFlask:
logging.getLogger('pycroft').addHandler(default_handler)

app = make_app()
# TODO rename to `default_config.toml`
app.config.from_pyfile("flask.cfg")
app.config.from_file("default_config.toml", load=tomllib.load, text=False)
app.config.from_prefixed_env()

engine = create_engine(get_connection_string())
with engine.connect() as connection:
Expand Down
File renamed without changes.

0 comments on commit f8a581f

Please sign in to comment.