Skip to content

Commit 66bf458

Browse files
author
metworkbot
committed
build: sync common files from github_organization_management repository
1 parent 2bf2bd2 commit 66bf458

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

README.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,6 @@
1212

1313

1414

15-
## What is it ?
16-
17-
This is a [jinja2](http://jinja.pocoo.org/) extension to access to system
18-
environment variables. It is usefull if you have dynamically generated
19-
variable names.
20-
21-
## Syntax
22-
23-
The syntax is `{{ 'ENV_VAR'|getenv }}` to access to the `ENV_VAR` environment
24-
variable. Don't forget the quotes around `ENV_VAR` !
25-
26-
If you want to provide a default value to avoid an exception if the corresponding
27-
environment variable does not exist, you can use the following syntax:
28-
`{{ 'ENV_VAR'|getenv('default_value') }}`.
29-
30-
## Examples
31-
32-
```python
33-
34-
from jinja2 import Template, Environment
35-
36-
# We load the extension in a jinja2 Environment
37-
env = Environment(extensions=["jinja2_getenv_extension.GetenvExtension"])
38-
39-
# For the example, we use a template from a simple string
40-
template = env.from_string("the value of HOME environment variable is: "
41-
"{{ 'HOME'|getenv }}")
42-
result = template.render()
43-
44-
# [...]
45-
```
4615

4716

4817

0 commit comments

Comments
 (0)