Created
November 13, 2013 04:01
-
-
Save kurap/7443511 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================== | |
## | |
## 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