
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
jinja2-getenv-extension
Advanced tools
Status (master branch)
This is a jinja2 extension to access to system environment variables. It is usefull if you have dynamically generated variable names.
The syntax is {{ 'ENV_VAR'|getenv }}
to access to the ENV_VAR
environment
variable. Don't forget the quotes around ENV_VAR
!
If you want to provide a default value to avoid an exception if the corresponding
environment variable does not exist, you can use the following syntax:
{{ 'ENV_VAR'|getenv('default_value') }}
.
from jinja2 import Template, Environment
# We load the extension in a jinja2 Environment
env = Environment(extensions=["jinja2_getenv_extension.GetenvExtension"])
# For the example, we use a template from a simple string
template = env.from_string("the value of HOME environment variable is: "
"{{ 'HOME'|getenv }}")
result = template.render()
# [...]
See CONTRIBUTING.md file.
See CODE_OF_CONDUCT.md file.
(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)
FAQs
a jinja2 extension to access to system environment variables
We found that jinja2-getenv-extension demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.