title: Trouble serving MEDIA and STATIC files of Django in Apache
body: <p>I am using Django 1.8, python 3.4.3 and Apache 2.4.7, I have tried a lot of configurations and I can't see what I'm doing wrong. When I was using debug mode everything but the images was running perfect, and I solved the images issue by using this on urls.py:</p>
  
  <pre><code>url(r'^media/(?P&lt;path&gt;.*)$', 'django.views.static.serve',
                          {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
  </code></pre>
  
  <p>Later I turned <code>DEBUG=False</code> and the Images stopped working, thats why started to read about serving Static and Media files on Apache. And with the basic configurations everything seemed to be working right, but the images stopped working again, and after trying some configurations My App CSS and JS just stopped working, so I used <code>collectstatic</code> and after that, also the Admin lost its CSS and Js, but when I turn it <code>True</code> again, CSS and JS starts working again on both, App and Admin. </p>
  
  <p>Now on DEBUG=False nothing is working, admin Static, my app Static files, and media files, nothing.</p>
  
  <p>These are my settings:</p>
  
  <pre><code>BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
  
  MEDIA_ROOT = PROJECT_ROOT + '/archivos/'
  MEDIA_URL = '/archivos/'  #put whatever you want that when url is rendered it will be /archivos/imagename.jpg
  
  DEBUG =  True #False
  
  ALLOWED_HOSTS = ['localhost','127.0.0.1'] 
  
  STATIC_URL = '/static/'
  STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  </code></pre>
  
  <p>This is my <code>/etc/apache2/sites-enabled/000-default.conf</code> file:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
  &lt;/VirtualHost&gt;
  
  
  
  &lt;VirtualHost *:80&gt;
      ServerName django.myproject
      Alias /static /home/developer/myproject/static
  
      &lt;Directory /home/developer/myproject/static&gt;
          Require all granted
      &lt;/Directory&gt;
  
      Alias /archivos/ /home/developer/myproject/archivos/
  
      &lt;Directory /home/developer/myproject/archivos&gt;
          Require all granted
      &lt;/Directory&gt;
  
      &lt;Directory /home/developer/myproject/myapp&gt;
          &lt;Files wsgi.py&gt;
              Require all granted
          &lt;/Files&gt;
      &lt;/Directory&gt;
  
      WSGIDaemonProcess myproject python-path=/home/developer/myproject:/home/developer/myproject/projectvenv/lib/python3.4/site-packages
      WSGIProcessGroup myproject
      WSGIScriptAlias / /home/developer/myproject/projectsystem/wsgi.py
  
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>If I turn Debug=True, CSS and JS of Admin and App starts working again, only the images (media files) don't. </p>