Supervising virtualenv django app via supervisor

前端 未结 1 1196
终归单人心
终归单人心 2020-12-07 12:49

I\'m trying to use supervisor in order to manage my django project running gunicorn inside a virtualenv. My conf file looks like this:

[program:diasporamas         


        
1条回答
  •  有刺的猬
    2020-12-07 13:09

    The documentation for the virtualenv activate script says that it only modifies the PATH environment variable, in which case you can do:

    [program:diasporamas]
    command=/var/www/django/bin/gunicorn_django
    directory=/var/www/django/django_test
    environment=PATH="/var/www/django/bin"
    ...
    

    Since version 3.2 you can use variable expansion to preserve the existing PATH too:

    [program:diasporamas]
    command=/var/www/django/bin/gunicorn_django
    directory=/var/www/django/django_test
    environment=PATH="/var/www/django/bin:%(ENV_PATH)s"
    

    ...

    0 讨论(0)
提交回复
热议问题