You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Firstly, thank you for the great work - I've fallen in love with Starlette and am looking forward to the great things ahead.
I noticed that the Config object only takes in one .env file. I was thinking that it might be worthwhile to handle multiple .env files as there could be scenarios where we keep multiple .env files based on what these environment variables logically belong to.
For example, .db.env might have env vars for DB related configurations, while .web.env might have env vars specific to the Starlette application (e.g. DEBUG).
Off of my head after looking at the source code, this could naively be implemented by adding an env_dir keyword argument and looping through any files in it that match a certain regex. Maybe something like:
I guess we may actually end up pulling the configuration stuff out into a strictly seperate package (or indeed even just pointing at python-decouple - since it's the same style).
With 12-factor config you really should have a fairly small set of environment. (Eg. the database configuration should just be a single URL.)
What we will want to do though is provide really good examples of how to arrange things sensibly, so that eg. you have a project that has a settings.py that includes a whole bunch of project configuration, and which you can arrange into seperate bits, and demonstrate clearly how the environment should be a small set of variables, but the project settings may be more comprehensive.
We could perfectly well also point to other configuration-manangement packages that're out there as alternatives.
Hello! Firstly, thank you for the great work - I've fallen in love with Starlette and am looking forward to the great things ahead.
I noticed that the
Config
object only takes in one.env
file. I was thinking that it might be worthwhile to handle multiple.env
files as there could be scenarios where we keep multiple.env
files based on what these environment variables logically belong to.For example,
.db.env
might have env vars for DB related configurations, while.web.env
might have env vars specific to the Starlette application (e.g. DEBUG).Off of my head after looking at the source code, this could naively be implemented by adding an
env_dir
keyword argument and looping through any files in it that match a certain regex. Maybe something like:The text was updated successfully, but these errors were encountered: