python-dependency-injector/examples/miniapps/flask-blueprints/githubnavigator/application.py

22 lines
453 B
Python
Raw Normal View History

2020-11-16 02:00:43 +03:00
"""Application module."""
from flask import Flask
from flask_bootstrap import Bootstrap
from .containers import Container
from .blueprints import example
def create_app() -> Flask:
container = Container()
container.config.github.auth_token.from_env("GITHUB_TOKEN")
2020-11-16 02:00:43 +03:00
app = Flask(__name__)
app.container = container
app.register_blueprint(example.blueprint)
bootstrap = Bootstrap()
bootstrap.init_app(app)
return app