I am trying to configure MEDIA_URL for my Heroku application, which is currently serving static files via STATIC_URL from Amazon S3. Static files work fine, but when I try to add MEDIA_URL in addition to the current STATIC_URL, the pages no longer appear at all and the application stops working.
Current Settings:
AWS_STORAGE_BUCKET_NAME = 'bucketname'
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
S3_URL = 'http://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
STATIC_URL = S3_URL
AWS_ACCESS_KEY_ID = 'KEY'
AWS_SECRET_ACCESS_KEY = 'SECRET_KEY'
When I add:
MEDIA_URL = S3_URL
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
what causes the problem. In particular, MEDIA_URL is problematic, because when DEFAULT_FILE_STORAGE is deleted, it still has the same problem. But I am trying to determine how to best serve the media uploaded by the user using this to no avail.
If someone has an idea of how best to achieve this, it would be very helpful.