title: Why isnt Django not loading built-in static files?
body: <p>I have a Django instance set up on an Apache server running through uWSGI hunky dory. Everything looks perfect on my local machine when I use <code>python manage.py runserver</code>. Unfortunately, the minute I uploaded the files to my pre-prepared production server, it refused to load all of Django's built-in static files, returning a 404 and I have no idea why...</p>
  <p>The url that is being queried is listed as <code>www.mysite.com/static/admin/css/fonts.css</code> and is similar for the admin backend(<code>css/base.css</code>,<code>css/dashboard.css</code>and<code>css/responsive.css</code>). At first I thought it might be something wrong with the packages so I force-reinstalled Django but no go. Still not loading...</p>
  <p>Here is my uWSGI config .ini:</p>
  <pre><code>[uwsgi]
  chdir = /path/to/top/level/mysite
  module = mysite.wsgi:application
  env = DJANGO_SETTINGS_MODULE=mysite.settings
  master = true
  pidfile = /path/to/project.pid
  socket = 127.0.0.1:49152
  ; Dont use UNIX sockets as it confuses the proxy and alters the request 
  : URL's. Current Apache version cant handle it.
  ; socket=/var/run/swerth_django.sock
  processes = 5
  harakiri = 20
  post-buffering = 1
  max-requests = 5000
  vacuum = true
  home = /path/to/top/level/Virtualenv/directory
  daemonize = /path/to/uWSGI.log
  env = LANG=en_US.UTF-8
  enable-threads = true
  </code></pre>
  <p>And I have included Static root and url as follows (comments were for my own understanding):</p>
  <pre><code>#The URL of which the static files in STATIC_ROOT directory are served
  STATIC_URL = '/static/'
  
  #The absolute path to the directory where ./manage.py collectstatic
  # will collect static files for deployment.
  STATIC_ROOT = '/home/swerth/public_html/swerth/static'
  </code></pre>
  <p>It is worth mentioning however, I do not have any static files of my own as of yet. I am not at that point in development. I simply want to use the templates shipped with Django.</p>
  <h1>Edit:</h1>
  <p>Ok, so I did some research and managed to narrow it down a bit (Thank you to <a href="https://stackoverflow.com/users/113962/alasdair">@Alasdair</a> for pointing out a particular page in the Django docs). It seems that I can run <code>python manage.py collectstatic</code> just fine and it imports all the files I need into <code>www.mysite.com/static</code>. For some reason however, django dosnt seem to be 'seeing' the files as they don't render in browser (404 not found).</p>
  <p>In light of this I am assuming its my config in <code>settings.py</code>?</p>
  <pre><code># Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/2.1/howto/static-files/
  
  #The URL of which the static files in STATIC_ROOT directory are 
  #served
  STATIC_URL = '/static/'
  
  #The absolute path to the directory where ./manage.py collectstatic
  # will collect static files for deployment.
  STATIC_ROOT = os.path.join(BASE_DIR, &quot;static&quot;)
  
  STATICFILES_DIRS = [
  os.path.join(BASE_DIR, 'static')
  ]
  </code></pre>
  <p>My Apache is set up as a reverse proxy using the following config:</p>
  <pre><code>RewriteEngine off
  ProxyPreserveHost on
  ProxyPass &quot;/&quot;  &quot;uwsgi://127.0.0.1:49152/&quot;
  ProxyPassReverse &quot;/&quot; &quot;uwsgi://127.0.0.1:49152/&quot;
  </code></pre>
  <p>Am I doing this wrong or something? (P.s. I am trying to avoid having to edit the HTML files static file link as I really would prefer to know WHAT I'm doing wrong so it doesn't happen again since Django should be able to serve straight from <code>www.mysite.com/static</code>)</p>
  <h1>Edit Round 2:</h1>
  <p>Ok, so I did as suggested and tried to set up my proxy to exclude the static directory and just serve the files normally and added an alias to map the URL to the actual directory but it still isn't working properly. It seems to completely ignore my <code>ProxyPass</code> exception and sends it off to Django even though I included it above the less specific rule? Interesting issue, when I specify <code>/admin/</code> instead of just <code>/</code> for the less-specific <code>ProxyPass</code>, it only proxies that URL to Django, however, all of a sudden Django kicks up a 404 for <code>/admin/</code>. Additionally, I get a <code>403</code> forbidden for the static files I was trying to serve?!?! My current .conf looks like this:</p>
  <pre><code>Alias /static/ /home/swerth/public_html/swerth/static/
  
  &lt;Directory /home/swerth/public_html/swerth/static/&gt;
      Require all granted
  &lt;/Directory&gt;
  
  &lt;Directory /home/swerth/public_html/swerth/swerth/&gt;
  &lt;Files wsgi.py&gt;
      Require all granted
  &lt;/Files&gt;
  &lt;/Directory&gt;
  
  ProxyPreserveHost on
  ProxyPass /whm-server-status/ !
  ProxyPass /static/ !
  ProxyPass /  uwsgi://127.0.0.1:49152/
  ProxyPassReverse / uwsgi://127.0.0.1:49152/
  </code></pre>