title: How does Gunicorn collect static?
body: <p>I'm trying to use gunicorn to serve static files before configuring nginx as reverse proxy and I got a little bit confused.</p>
  
  <p>When I run my applications it seems like gunicorn is not able to find the static folder into the application.</p>
  
  <p>I have the following script to run my Django application.</p>
  
  <pre><code>#!/bin/bash
  
  # Start with development server
  # echo Start server.
  # python manage.py runserver 0.0.0.0:8000
  
  # python manage.py collectstatic --noinput  # Collect static files
  
  # # Prepare log files and start outputting logs to stdout
  touch /srv/logs/gunicorn.log
  touch /srv/logs/access.log
  tail -n 0 -f /srv/logs/*.log &amp;
  
  # # Start Gunicorn processes
  echo Starting Gunicorn.
  exec gunicorn django_project.wsgi:application \
      --name ds4dems \
      --bind 0.0.0.0:8000 \
      --workers 3 \
      --log-level=info \
      --log-file=/srv/logs/gunicorn.log \
      --access-logfile=/srv/logs/access.log \
      "$@"
  </code></pre>
  
  <p>The result is that style and images are not collected from main_app static folder. </p>
  
  <p>Folder structure is the following.</p>
  
  <pre><code>django_project
  ---- django_project
  ---- main_app
  -------- static
  </code></pre>
  
  <p>Following I tried to run the same application with development server and the statics are collected. Then I rerun with Gunicorn and styles and images are served to the browser without errors.</p>
  
  <p>What exactly is going on?</p>
  
  <p>Does it have to do with <a href="https://stackoverflow.com/questions/20175243/django-gunicorn-not-load-static-files" title="this">this</a>? Is the only available option to set nginx to let him see the files?</p>