title: set up pipenv with supervisor
body: <p>I want to deploy dev server but I have a problem with starting celery and gunicorn. I'm using scripts for my purposes</p>
  
  <p>celery.sh</p>
  
  <pre><code>#!/bin/bash 
  cd /home/dev/app
  pipenv run celery -A config worker -B -l info
  </code></pre>
  
  <p>and start.sh for gunicorn</p>
  
  <pre><code>#!/bin/bash
  cd /home/dev/app
  pipenv run gunicorn config.wsgi:application -b 127.0.0.1:8005 -w 2 -t 60 \
  
      --env DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE \
  
      --env DSN=$SENTRY_DSN \
  
      --env DATABASE_URL=$DATABASE_URL \
  
      --log-file - \
  
      --error-logfile /home/dev/app/errors.log 
  </code></pre>
  
  <p>Also here is my config for supervisor</p>
  
  <pre><code>[program:back]
  directory=/home/dev/app/
  command=/home/dev/bin/start
  user=dev
  autostart=true
  autorestart=true
  redirect_stderr=true
  stopsignal=QUIT
  stopasgroup=true
  killasgroup=true
  
  
  [program:celery]
  directory=/home/dev/app/
  command=/home/dev/bin/celery
  user=dev
  autostart=true
  autorestart=true
  redirect_stderr=true
  stopsignal=QUIT
  stopasgroup=true
  killasgroup=true
  </code></pre>
  
  <p>When I'm running <code>sudo supervisorctl start celery</code> I'm getting the following error:
  <code>/home/dev/bin/celery: line 3: pipenv: command not found</code></p>
  
  <p>Also I added the following lines as pipenv documentation says (<a href="https://pipenv.readthedocs.io/en/latest/diagnose/" rel="noreferrer">https://pipenv.readthedocs.io/en/latest/diagnose/</a>)</p>
  
  <pre><code>[supervisord]
  environment=LC_ALL='en_US.UTF-8',LANG='en_US.UTF-8'
  </code></pre>
  
  <h2>UPDATE</h2>
  
  <p>Changed my supervisor config:</p>
  
  <pre><code>[program:back]
  directory=/home/dev/app/
  command=pipenv run gunicorn config.wsgi:application --bind 127.0.0.1:8005
  user=dev
  autostart=true
  autorestart=true
  redirect_stderr=true
  stopsignal=QUIT
  stopasgroup=true
  killasgroup=true
  
  
  [program:celery]
  directory=/home/dev/app/
  command=pipenv run celery -A config:celery_app worker -B -l info
  user=dev
  autostart=true
  autorestart=true
  redirect_stderr=true
  stopsignal=QUIT
  stopasgroup=true
  killasgroup=true
  </code></pre>
  
  <p>And now I'm getting an error:</p>
  
  <pre><code>back: ERROR (no such file)
  </code></pre>