-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsgi.py
30 lines (21 loc) · 904 Bytes
/
wsgi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import kerko
from flask import Flask
from flask_babel import Babel
from flask_bootstrap import Bootstrap4
from kerko.composer import Composer
from kerko.config_helpers import config_set, config_update, parse_config
app = Flask(__name__)
# Initialize app configuration with Kerko's defaults.
config_update(app.config, kerko.DEFAULTS)
# Update app configuration from environment variables.
app.config.from_prefixed_env(prefix="MYAPP")
# Make changes to the Kerko configuration here, if desired.
config_set(app.config, "kerko.meta.title", "My App")
# Validate configuration and save its parsed version.
parse_config(app.config)
# Initialize the Composer object.
app.config["kerko_composer"] = Composer(app.config)
# Make changes to the Kerko composer object here, if desired.
babel = Babel(app)
bootstrap = Bootstrap4(app)
app.register_blueprint(kerko.make_blueprint(), url_prefix="/bibliography")