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