title: how to setup supervisor for django
body: <p>I have a problem with my configurations from the supervisor, well this is happening.</p>
  
  <p>my app is a server web socket when a run with de gunicorn like this </p>
  
  <pre><code>#&gt;gunicorn --bind 0.0.0.0:8001 colonybit.asgi:application
  </code></pre>
  
  <p>this command run perfectly, but web sockets not working, when I run with the command traditional from django like this:</p>
  
  <pre><code>#&gt;python manage.py runserver 0.0.0.0.0:8001
  </code></pre>
  
  <p>working well, but the server is down if don't an activity, and decide install supervisor, I run this command $ sudo supervisorctl reread, not working and send me this message error like this</p>
  
  <pre><code>error: &lt;class 'socket.error'&gt;, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228
  </code></pre>
  
  <p>I followed these tutorials </p>
  
  <p>1: <a href="http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/" rel="nofollow noreferrer">http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/</a></p>
  
  <p>and this</p>
  
  <p>2: <a href="https://github.com/rfk/django-supervisor#configuration" rel="nofollow noreferrer">https://github.com/rfk/django-supervisor#configuration</a></p>
  
  <p>the first tutorial uses it gunicorn, but I not use it
  the second user django-supervisor but is discontinued</p>
  
  <p>my configurations is:</p>
  
  <p>root@ip-172-31-28-226:/etc/supervisor/conf.d# </p>
  
  <p>realtimecolonybit.conf</p>
  
  <pre><code>    [program:realtimecolonybit]
        command = /home/ubuntu/realtimecolonybit/colonybit/manage.py 
        runserver host=0.0.0.0 port=8001 ; Command to start app
        user = root                                                         ; User to run as
        stdout_logfile = /home/ubuntu/realtimecolonybit/logs/realtime.log   ; Where to write log messages
        redirect_stderr = true                                                ; Save stderr in the same log
        environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8                       ; Set UTF-8 as default encoding
  </code></pre>
  
  <p>please help me, how to config my server using python manage.py etc</p>
  
  <p>I work with web sockets and use django-channels, python3.6, my machine is AWS in ubuntu LTS</p>
  
  <p>thank for your attention.</p>
  
  <p>regards
  Ngel</p>