Skip to content

Instantly share code, notes, and snippets.

@BigglesZX
Created March 5, 2012 13:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigglesZX/1978416 to your computer and use it in GitHub Desktop.
Save BigglesZX/1978416 to your computer and use it in GitHub Desktop.
Django settings for S3-based media files
'''
We use S3 as our media backend on Heroku, so set that up
'''
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = "YOUR_AWS_KEY"
AWS_SECRET_ACCESS_KEY = "YOUR_AWS_SECRET"
AWS_STORAGE_BUCKET_NAME = "YOUR_S3_BUCKET_NAME"
'''
Adjust media URL to point directly to S3
'''
MEDIA_URL = 'http://your_s3_bucket_name.s3.amazonaws.com/'
'''
Adjust thumbnail storage
'''
THUMBNAIL_DEFAULT_STORAGE = DEFAULT_FILE_STORAGE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment