How to avoid putting environment variables into multiple places with Django, nginx and uWSGI?

后端 未结 3 1522
你的背包
你的背包 2021-02-04 09:42

I am trying to configure nginx+uWSGI to serve my Django application.

When I put environment variables into myapp_uwsgi.ini:



        
3条回答
  •  不要未来只要你来
    2021-02-04 10:08

    Here is the answer from uWSGI developers:

    just place each of them (one per line) in a text file in the form

    VAR=VALUE

    then in uWSGI config

    [uwsgi]
    for-readline = yourfile
      env = %(_)
    endfor =
    

    This also works with yml config files:

      for-readline: filename
        env: %(_)
      endfor:
    

提交回复
热议问题