mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-23 01:56:58 +03:00
24 lines
524 B
Python
24 lines
524 B
Python
|
"""Application module."""
|
||
|
|
||
|
from flask import Flask
|
||
|
from flask_bootstrap import Bootstrap
|
||
|
|
||
|
from .containers import Container
|
||
|
from . import views
|
||
|
|
||
|
|
||
|
def create_app() -> Flask:
|
||
|
container = Container()
|
||
|
container.config.from_yaml('config.yml')
|
||
|
container.config.github.auth_token.from_env('GITHUB_TOKEN')
|
||
|
container.wire(modules=[views])
|
||
|
|
||
|
app = Flask(__name__)
|
||
|
app.container = container
|
||
|
app.add_url_rule('/', 'index', views.index)
|
||
|
|
||
|
bootstrap = Bootstrap()
|
||
|
bootstrap.init_app(app)
|
||
|
|
||
|
return app
|