问题描述:

My supervisor configuration file:

[program:dashboard]

command = /home/ubuntu/dashboard/bin/gunicorn manage:app -w 4

directory = /home/ubuntu/dashboard

autostart=true

autorestart=true

user = ubuntu

stdout_logfile = /home/ubuntu/dashboard/logs/gunicorn/gunicorn_stdout.log

stderr_logfile = /home/ubuntu/dashboard/logs/gunicorn/gunicorn_stderr.log

redirect_stderr = True

environment=SECRET_KEY="a_key",FLASK_CONFIG="production",DB_HOST="a_host",DB_PASSWORD="a_password",DB_USERNAME="a_username"

In my Flask app I read the values like:

DB_HOST = os.environ.get('DB_HOST')

DB_USERNAME = os.environ.get('DB_USERNAME')

DB_PASSWORD = os.environ.get('DB_PASSWORD')

But this doesn't work. These fields are defined as NoneType.

相关阅读:
Top