Skip to content

Instantly share code, notes, and snippets.

@kurap
Created November 13, 2013 04:01
Show Gist options
  • Save kurap/7443511 to your computer and use it in GitHub Desktop.
Save kurap/7443511 to your computer and use it in GitHub Desktop.
#==============================================================================
##
## Django S3 settings (ubuntu)
##
#==============================================================================
#### install boto using PYPI
sudo pip install boto
#### install django-storage for Django
pip install django-storages
#### edit env
vi /etc/bash.bashrc
## edit bash.bashrc
# export AWS_ACCESS_KEY_ID=[ID]
# export AWS_SECRET_ACCESS_KEY=[ACCESS_KEY]
#### edit setting.py
## add the following lines
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
#### edit url.py
## add following line to import lines
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
## add following line to the end
urlpatterns += staticfiles_urlpatterns()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment