Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set environment variables in Supervisor service

To add a single environment variable, You can do something like this.

[program:django]
environment=SITE=domain1
command = python manage.py command

But, if you want to export multiple environment variables, you need to separate them by comma.

[program:django]
environment = 
    SITE=domain1,
    DJANGO_SETTINGS_MODULE=foo.settings.local,
    DB_USER=foo,
    DB_PASS=bar
command = python manage.py command

Just do it separately:

environment=SITE=domain1
command=python manage.py command

Refer to http://supervisord.org/subprocess.html#subprocess-environment for more info.