mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-23 01:56:58 +03:00
6eff213a68
* Add bootstrap and remove created at from ghnav-flask app * Update readme * Add logo to the docs * Update key features description * Update README * Change headers of API docs * Add alabaster theme config * Update docs index * Add tutorials section * Update what is DI page * Update DI in Python page * Update tutorials index page * Update provider docs * Update container docs * Update examples docs
21 lines
496 B
Python
21 lines
496 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
|
|
|
|
bootstrap = container.bootstrap()
|
|
bootstrap.init_app(app)
|
|
|
|
app.add_url_rule('/', view_func=container.index_view.as_view())
|
|
|
|
return app
|