Tlapbot/tlapbot/__init__.py

26 lines
563 B
Python
Raw Normal View History

2022-08-22 16:43:56 +02:00
import os # for using paths in config
2022-06-08 14:22:58 +02:00
from flask import Flask
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
2022-08-22 16:43:56 +02:00
app.config.from_object('tlapbot.default_config')
app.config.from_object('tlapbot.config')
2022-06-08 14:22:58 +02:00
# ensure the instance folder exists
try:
os.makedirs(app.instance_path)
except OSError:
pass
from . import db
2022-08-24 13:47:55 +02:00
from . import owncast_webhooks
app.register_blueprint(owncast_webhooks.bp)
2022-06-08 14:22:58 +02:00
db.init_app(app)
return app
2022-06-08 14:22:58 +02:00
if __name__ == '__main__':
create_app()