mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-03-12 15:55:47 +03:00
Update documentation
This commit is contained in:
parent
1d979f01c4
commit
bb3f770ccd
|
@ -45,6 +45,21 @@ where ``examples/providers/configuration/config.ini`` is:
|
||||||
.. literalinclude:: ../../examples/providers/configuration/config.ini
|
.. literalinclude:: ../../examples/providers/configuration/config.ini
|
||||||
:language: ini
|
:language: ini
|
||||||
|
|
||||||
|
Alternatively, you can provide a path to the INI file over the configuration provider argument. In that case,
|
||||||
|
the container will call ``config.from_ini()`` automatically:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
:emphasize-lines: 3
|
||||||
|
|
||||||
|
class Container(containers.DeclarativeContainer):
|
||||||
|
|
||||||
|
config = providers.Configuration(ini_files=["./config.ini"])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
container = Container() # Config is loaded from ./config.ini
|
||||||
|
|
||||||
|
|
||||||
:py:meth:`Configuration.from_ini` method supports environment variables interpolation.
|
:py:meth:`Configuration.from_ini` method supports environment variables interpolation.
|
||||||
|
|
||||||
.. code-block:: ini
|
.. code-block:: ini
|
||||||
|
|
Loading…
Reference in New Issue
Block a user