mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-27 03:54:00 +03:00
18 lines
429 B
Python
18 lines
429 B
Python
"""Application module."""
|
|
|
|
from .containers import ApplicationContainer
|
|
|
|
|
|
def create_app():
|
|
"""Create and return Flask application."""
|
|
container = ApplicationContainer()
|
|
container.config.from_yaml('config.yml')
|
|
container.config.github.auth_token.from_env('GITHUB_TOKEN')
|
|
|
|
app = container.app()
|
|
app.container = container
|
|
|
|
app.add_url_rule('/', view_func=container.index_view.as_view())
|
|
|
|
return app
|