Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gunicorn conf file, environment variables syntax #1472

Closed
leonardbinet opened this issue Feb 27, 2017 · 4 comments
Closed

Gunicorn conf file, environment variables syntax #1472

leonardbinet opened this issue Feb 27, 2017 · 4 comments

Comments

@leonardbinet
Copy link

Hello,
In the documentation, it is written that there is no special syntax for config, but I don't understand how to use the env parameter to pass multiple values.

Should I use a dictionary to pass multiple values?

For instance I would like to pass environment variables in gunicorn processes, my gunicorn_config.py file is:

bind = "127.0.0.1:8887"
log_file = "path/to/logs/gunicorn_logs.txt"
workers = 3

# Environment variables
env = {
    "DJANGO_SECRET_KEY": "something",
    "OTHER_SECRET": "something_else"
    }

But it doesn't work. Is my syntax right?
Thanks in advance

@leonardbinet
Copy link
Author

Ok, in found it:

# Environment variables
raw_env = [
    "DJANGO_SECRET_KEY=something",
    "OTHER_SECRET=something_else"
    ]

@benoitc
Copy link
Owner

benoitc commented Mar 4, 2017

ok, closing the issue since you found it :)

@benoitc benoitc closed this as completed Mar 4, 2017
@benoitc benoitc moved this from Answered, waiting to To close in Forum Mar 4, 2017
@alexprengere
Copy link

Hello, I was stuck on this exact issue today, because I used the example which is not up to date with the latest docs. Thanks to this issue, I could find raw_env though 😉

berkerpeksag added a commit that referenced this issue Mar 27, 2018
@berkerpeksag
Copy link
Collaborator

@alexprengere I've just added an example to examples/example_config.py in 01a1c7c.

marcanuy added a commit to marcanuy/gunicorn that referenced this issue Sep 2, 2020
It was documented the usage of the cli parameter `env` but in the config file it should be `raw_env`.
Related issue benoitc#1472
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Forum
To close
Development

No branches or pull requests

4 participants