title: Media files are served, static files aren't
body: <p>I'm stuck due to <a href="https://stackoverflow.com/questions/8618611/serving-django-static-files-in-development-envirnoment">an</a> <a href="https://stackoverflow.com/questions/5602263/serving-static-files-for-development-mode-in-django">evergreen</a> <a href="https://stackoverflow.com/questions/10806287/serving-static-files-in-django-development">issue</a>, static files not served. Conversely the files placed in the <code>MEDIA_ROOT</code> subtree get served correctly under <code>MEDIA_URL</code>.</p>
  
  <p>Stripped <code>settings.py</code>:</p>
  
  <pre><code>DEBUG = True
  STATIC_URL = '/static/'
  STATIC_ROOT = '/home/foo/devel/static'
  MEDIA_URL = '/media/'
  MEDIA_ROOT = '/home/foo/devel/media'
  # the following is deprecated but is it seems grappelly requires it
  ADMIN_MEDIA_PREFIX = STATIC_URL + "grappelli/"
  STATIC_FILES = ()
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  )
  </code></pre>
  
  <p>To create the project I did:</p>
  
  <pre><code>$ cd /home/foo/devel/
  $ virtualenv testdrive
  $ . bin/activate; pip install django; cd testdrive
  $ django-admin.py fbtest
  </code></pre>
  
  <p>and got this directory tree (stripped):</p>
  
  <pre><code>. &lt;-- /home/foo/devel/
  ├── bin
  ├── fbtest
  │   └── fbtest
  │       ├── media
  │       │   └── foo.jpg
  │       ├── static
  │       └────── foo.jpg
  ├── include
  └── lib
  </code></pre>
  
  <p>Files under <code>STATIC_URL</code> should be served automatically by Django staticfiles (not in my case), while other files have to be handled manually. So I appended these lines to <code>urls.py</code>:</p>
  
  <pre><code>import settings
  if settings.DEBUG:
      urlpatterns += patterns('',
          url(r'^%s(?P&lt;path&gt;.*)$' % settings.MEDIA_URL.lstrip("/"),
              'django.views.static.serve', {
              'document_root': settings.MEDIA_ROOT,
          }),
      )
  </code></pre>
  
  <p>Accessing <code>http://host/media/filebrowser/foo.jpg</code> works, while <code>http://host/static/foo.jpg</code> gives error 404. Why?</p>