mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-03-25 12:24:22 +03:00
Update readme
This commit is contained in:
parent
62ebe8d6b9
commit
1be15f4506
|
@ -72,6 +72,7 @@ This place is called **the container**. You use the container to manage all the
|
|||
from dependency_injector import containers, providers
|
||||
from dependency_injector.ext import flask
|
||||
from flask import Flask
|
||||
from flask_bootstrap import Bootstrap
|
||||
from github import Github
|
||||
|
||||
from . import views, services
|
||||
|
@ -82,6 +83,8 @@ This place is called **the container**. You use the container to manage all the
|
|||
|
||||
app = flask.Application(Flask, __name__)
|
||||
|
||||
bootstrap = flask.Extension(Bootstrap)
|
||||
|
||||
config = providers.Configuration()
|
||||
|
||||
github_client = providers.Factory(
|
||||
|
@ -118,6 +121,9 @@ Running such container looks like this:
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user