File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,21 @@ where ``examples/providers/configuration/config.ini`` is:
45
45
.. literalinclude :: ../../examples/providers/configuration/config.ini
46
46
:language: ini
47
47
48
+ Alternatively, you can provide a path to the INI file over the configuration provider argument. In that case,
49
+ the container will call ``config.from_ini() `` automatically:
50
+
51
+ .. code-block :: python
52
+ :emphasize- lines: 3
53
+
54
+ class Container (containers .DeclarativeContainer ):
55
+
56
+ config = providers.Configuration(ini_files = [" ./config.ini" ])
57
+
58
+
59
+ if __name__ == " __main__" :
60
+ container = Container() # Config is loaded from ./config.ini
61
+
62
+
48
63
:py:meth: `Configuration.from_ini ` method supports environment variables interpolation.
49
64
50
65
.. code-block :: ini
You can’t perform that action at this time.
0 commit comments