From bb3f770ccde7569c7d2f8ddf06e8eb5a2070bf3f Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Tue, 26 Oct 2021 20:21:50 -0400 Subject: [PATCH] Update documentation --- docs/providers/configuration.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/providers/configuration.rst b/docs/providers/configuration.rst index ca9669ad..ddacdd72 100644 --- a/docs/providers/configuration.rst +++ b/docs/providers/configuration.rst @@ -45,6 +45,21 @@ where ``examples/providers/configuration/config.ini`` is: .. literalinclude:: ../../examples/providers/configuration/config.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. .. code-block:: ini