diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-07-23 00:28:47 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-07-23 00:28:47 +0200 |
commit | 81493afa53a1a1d5ff4b417d05febf9f9e2a172b (patch) | |
tree | 00de0a1bb7c386cff4203aa7b0789569e75347bb /kosten/app/__init__.py | |
parent | 6f6c8af2a55fabb69372e3fc4e8504167805d018 (diff) | |
download | kosten-81493afa53a1a1d5ff4b417d05febf9f9e2a172b.tar.gz kosten-81493afa53a1a1d5ff4b417d05febf9f9e2a172b.tar.bz2 kosten-81493afa53a1a1d5ff4b417d05febf9f9e2a172b.zip |
Restructure
Diffstat (limited to 'kosten/app/__init__.py')
-rw-r--r-- | kosten/app/__init__.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/kosten/app/__init__.py b/kosten/app/__init__.py new file mode 100644 index 0000000..7c6408a --- /dev/null +++ b/kosten/app/__init__.py @@ -0,0 +1,32 @@ +from flask import Flask + +# create app +app = Flask('kosten', instance_relative_config = True) + +# force autoescape in all files +app.jinja_env.autoescape = True + +app.jinja_env.lstrip_blocks = True +app.jinja_env.trim_blocks = True + +# load config +app.config.from_object('settings') +app.config.from_pyfile('settings.py', silent = True) + +from .model import db +from .login import login_manager +from . import views + +# commands +@app.cli.command() +def create(): + db.create_all() + +@app.cli.command() +def drop(): + db.drop_all() + +@app.cli.command() +def compile(): + """Compiles all templates.""" + app.jinja_env.compile_templates('comp', zip = None) |