Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created July 2, 2020 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/71d013e77a0ea0892a31f0a3c7dbcd51 to your computer and use it in GitHub Desktop.
Save velotiotech/71d013e77a0ea0892a31f0a3c7dbcd51 to your computer and use it in GitHub Desktop.
$ pip install django-storages boto
Add Django-Storage to your INSTALLED_APPS in settings.py
INSTALLED_APPS = (
...,
storages',
)
Configure Django-storage in settings.py as
AWS_STORAGE_BUCKET_NAME = 'django-zappa-sample-bucket'
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
STATIC_URL = "https://%s/" % AWS_S3_CUSTOM_DOMAIN
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment