title: ImproperlyConfigured at / Empty static prefix not permitted - Django
body: <p>I'm working on uploading/displaying images with Django.</p>
  
  <p>The website is deployed on Heroku. </p>
  
  <p>Following <a href="https://coderwall.com/p/bz0sng" rel="noreferrer">this</a> tutorial I was able to successfully upload images.</p>
  
  <p>However, the images weren't being displayed in the template.</p>
  
  <p>I then learned that my urls.py should have this line at the end: </p>
  
  <pre><code>+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  </code></pre>
  
  <p>I added this to the end of my urls.py but now I'm getting this error:</p>
  
  <pre><code>ImproperlyConfigured at / Empty static prefix not permitted
  </code></pre>
  
  <p>I have MEDIA_URL and MEDIA_ROOT in my settings.py and neither are empty. </p>
  
  <pre><code>BASE_DIR = os.path.dirname(os.path.abspath(__file__))
  
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  
  # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  # trailing slash.
  # Examples: "http://example.com/media/", "http://media.example.com/"
  MEDIA_URL = '/media/'
  </code></pre>
  
  <p>Why is this error happening and how would I fix it?</p>
  
  <p>Here's what I think is the relevant part of my urls.py:</p>
  
  <pre><code>from django.contrib import admin
  from django.conf import settings
  from django.conf.urls.static import static
  import notifications
  admin.autodiscover()
  
  urlpatterns = patterns('',
      ....urls......
  
  ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  </code></pre>