title: Django - Media in production is not working
body: <p>My static files are working well, but my media ones have a problem. I already deployed my website in heroku and it is online in production. (DEBUG=False)
  Look at the code:</p>
  
  <p>settings.py</p>
  
  <pre><code>BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  DEBUG = bool(os.environ.get('DJANGO_DEBUG', True))
  STATIC_URL = '/static/'
  STATICFILES_DIRS = [
      os.path.join(BASE_DIR, "static"),
      # '/var/www/static/'
  ]
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  MEDIA_ROOT = os.path.join(BASE_DIR, "media")
  MEDIA_URL = '/media/'
  import dj_database_url
  db_from_env = dj_database_url.config(conn_max_age=500)
  DATABASES['default'].update(db_from_env)
  STATICFILES_STORAGE = 
  'whitenoise.storage.CompressedManifestStaticFilesStorage'
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>if settings.DEBUG:
      urlpatterns += static(settings.STATIC_URL, 
  document_root=settings.STATIC_ROOT)
      urlpatterns += static(settings.MEDIA_URL, 
  document_root=settings.MEDIA_ROOT)
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>cartaz = models.FileField(default='/static/images/logo.jpg')
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;img src="{{campeonato.cartaz.url}}" class="img-responsive"&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vjJVl.png" rel="nofollow noreferrer">My Github repository</a></p>
  
  <p>Here is the problem, I was uploading an image in the admin section and then it worked well, but suddenly after a couple minutes the image disappeared from the website and I got the following error: </p>
  
  <pre><code>Not Found:/media/tdscampeonatos_rzFCbET.jpg
  </code></pre>
  
  <p>Then I added a media repository inside my project in github with the images I had uploaded:</p>
  
  <p><a href="https://i.stack.imgur.com/QhlXo.png" rel="nofollow noreferrer">My Github repository after I added the media</a></p>
  
  <p>Then the images I had added to the media repository worked, but the ones I didn't added was still not working. I uploaded some more images and I got the same error, because the images was not going directly to the media path I had created in the Github repository. 
  5 days trying to fix this, I already looked for almost everything in internet. Please help me!</p>