title: What should django settings and urls look like for media and static deploying in production with heroku?
body: <p>Currently, I have been having issues with getting my static and media to work with django on heroku.  My static is finally working, but my media won't, and this is my first in any sort of production environment, so I'm not sure if it is done correctly. My media files will work after an upload, however they no longer work once I edit something unrelated and try to push it to heroku typing:</p>
  
  <pre><code>git add .
  git commit -m "changes"
  git push heroku master
  </code></pre>
  
  <p>So after I update my heroku app, a user would have to re-add their media files in order for them to work every time I do an update.  As far as the code I have so far:</p>
  
  <pre><code>#settings.py
  DEBUG = False
  MEDIA_ROOT = 'media'
  MEDIA_URL = '/media/'
  STATIC_ROOT = 'static'
  STATIC_URL = '/static/'
  STATICFILES_DIRS = (
      'static',
  )
  
  #urls.py
  urlpatterns += staticfiles_urlpatterns()
  
  if not settings.DEBUG:
      urlpatterns += patterns('',
          (r'^static/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
          (r'^media/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
      )
  </code></pre>
  
  <p>I'm pretty lost on what to do, and I have tried several different changes to my urls and settings without any luck.  I have read other posts and tried them, I've read the docs, and I still don't really understand unfortunately.  Everything was working fine in development, but I had different code for my project in development under my settings.  Any help would be greatly appreciated.</p>
  
  <p>EDIT</p>
  
  <p>So after more digging, I decided to give Amazon S3 a try for handling my media files.  I'm still not really sure how uploading files to S3 works, but I already created a S3 bucket and set my heroku settings (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, S3_BUCKET_NAME).  I am still unsure of what my media and static settings should look like.  If anyone can point me in the right direction, I would really appreciate it.</p>