mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-06 14:40:48 +03:00
Update README with ghnav container example
This commit is contained in:
parent
0417790c6f
commit
ea2f81f83a
13
README.rst
13
README.rst
|
@ -58,9 +58,10 @@ Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from dependency_injector import containers, providers
|
from dependency_injector import containers, providers
|
||||||
|
from dependency_injector.ext import flask
|
||||||
from github import Github
|
from github import Github
|
||||||
|
|
||||||
from . import services, views, webapp
|
from . import services, views
|
||||||
|
|
||||||
|
|
||||||
class Application(containers.DeclarativeContainer):
|
class Application(containers.DeclarativeContainer):
|
||||||
|
@ -87,19 +88,15 @@ Example:
|
||||||
)
|
)
|
||||||
|
|
||||||
app = providers.Factory(
|
app = providers.Factory(
|
||||||
webapp.create_app,
|
flask.create_app,
|
||||||
name=__name__,
|
name=__name__,
|
||||||
routes=[
|
routes=[
|
||||||
webapp.Route('/', 'index', index_view, methods=['GET']),
|
flask.Route('/', view_provider=index_view),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
You can find more ``Dependency Injector`` examples in the ``/examples`` directory
|
See complete ``Flask`` + ``Dependency Injector`` `example <https://github.com/ets-labs/python-dependency-injector/tree/master/examples/miniapps/ghnav-flask>`_
|
||||||
on the GitHub:
|
|
||||||
|
|
||||||
https://github.com/ets-labs/python-dependency-injector
|
|
||||||
|
|
||||||
|
|
||||||
How to install?
|
How to install?
|
||||||
---------------
|
---------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user