question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] Allow to fallback to unprefixed environment variable when value not found. was [Question] Using dynaconf, how would I go about getting the well known environment Linux variable "PATH"?

See original GitHub issue

If I just wanted to get the well known environment Linux variable PATH, how should I fetch it using dynaconf?

I tried:

settings.get('PATH', 'Noooope')

and always get Noooope

I am hoping for a behavior similar to os.environ["PATH"] but with all the (optional) dynaconf goodness, if they are present

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
rochacbrunocommented, Jun 1, 2022

I think the idea of this issue is to provide an API to get a value from settings and fallback to envvars.

To be implemented.

from dynaconf import Dynaconf

settings = Dynaconf(
	fallback_to_environ=True,
	fallback_to_environ=["PATH", ...],
)

print(settings.PATH)
# if not available on `settings` would fallback to `get_environ` and follow all the dynaconf formatting etc...

Right now the workaround is.

settings.get("PATH", default=settings.get_environ("PATH"))
Read more comments on GitHub >

github_iconTop Results From Across the Web

[RFC] Allow to fallback to unprefixed environment variable when ...
If I just wanted to get the well known environment Linux variable PATH , how should I fetch it using dynaconf? I tried:...
Read more >
Env vars - Dynaconf - 3.1.11
When loading environment variables, dynaconf will parse the value using toml language so it will try to automatic convert to the proper data ......
Read more >
python - Unable to install PyRFC-2.0.4 - Stack Overflow
1 Answer 1 · Create the SAP NW RFC SDK home directory, e.g. c:\nwrfcsdk · Set the SAPNWRFC_HOME env variable: SAPNWRFC_HOME=c:\nwrfcsdk · Unpack ......
Read more >
John: doc/CHANGES-jumbo - Fossies
No problem seen here but in other 6 places with similar code. ... See #958 109 Allow environment variable OMP_SCALE to override john.conf ......
Read more >
Issues · dynaconf/dynaconf · GitHub
[RFC] Allow to fallback to unprefixed environment variable when value not found. was [Question] Using dynaconf, how would I go about getting the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found