Including environment variables in uWSGI ini files?
Asked Answered
S

2

6

I am using .ini files (as per uWSGI docs). It's good practise to use environment variables, but I wasn't able to get the $+environment name syntax working.

Is there a special syntax I can use to access them?

Spitball answered 24/1, 2014 at 6:56 Comment(0)
I
17

The syntax is $(var), for example:

chdir = $(HOME)/foobar

See also How uWSGI parses config files.

Intradermal answered 24/1, 2014 at 7:2 Comment(2)
Is there a way to have a default (in case the env var is not set)?Deca
@roberto, also wondering about what David is asking. For example if I wanted to set the value for threads from an environment variable, but fall back to the default (1 thread per process) if the environment variable is not defined...?Mammillate
L
2

contents of evironment variables and external text files can be included using the $(ENV_VAR) and @(file_name) syntax. See also How uWSGI parses config files.

Legitimist answered 29/4, 2016 at 2:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.