jon/py/jon/__init__.py
2023-05-17 12:43:43 +02:00

27 lines
553 B
Python

import inspect
from flask import Flask, render_template
from . import db, inventory, location, template_utils
def create_app():
app = Flask(__name__)
app.config.from_mapping(
SECRET_KEY="dev"
)
db.init_app(app)
@app.context_processor
def utility_processor():
return dict(inspect.getmembers(template_utils, inspect.isfunction))
app.register_blueprint(location.bp)
app.register_blueprint(inventory.bp)
@app.route("/")
def index():
return render_template("index.html")
return app