python-dependency-injector/examples/miniapps/ghnav-flask/githubnavigator/application.py
Roman Mogylatov 6eff213a68
Migrate to alabaster (#264)
* 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
2020-07-18 00:40:14 -04:00

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