[buildinfo.debian.net] 03/07: Move default storage to S3.
Chris Lamb
chris at chris-lamb.co.uk
Sat Jan 28 21:58:58 UTC 2017
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository buildinfo.debian.net.
commit 37b8f4d7f93fb0399363bdf1980c008f5f17ba5e
Author: Chris Lamb <lamby at debian.org>
Date: Sun Jan 29 10:06:00 2017 +1300
Move default storage to S3.
Signed-off-by: Chris Lamb <lamby at debian.org>
---
bidb/settings/defaults/__init__.py | 10 +++++++++-
bidb/settings/roles/local.py | 5 ++++-
requirements.txt | 2 ++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/bidb/settings/defaults/__init__.py b/bidb/settings/defaults/__init__.py
index 2d0b48c..582e898 100644
--- a/bidb/settings/defaults/__init__.py
+++ b/bidb/settings/defaults/__init__.py
@@ -93,7 +93,15 @@ STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesSto
MEDIA_URL = '/storage/'
MEDIA_ROOT = 'overriden-in-production'
-DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
+
+DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
+
+AWS_DEFAULT_ACL = 'public-read'
+AWS_ACCESS_KEY_ID = 'overriden-in-production'
+AWS_QUERYSTRING_AUTH = False
+AWS_SECRET_ACCESS_KEY = 'overriden-in-production'
+AWS_QUERYSTRING_EXPIRE = 86400 * 7 * 12
+AWS_STORAGE_BUCKET_NAME = 'overriden-in-production'
BROKER_URL = 'redis://localhost:6379/0'
diff --git a/bidb/settings/roles/local.py b/bidb/settings/roles/local.py
index a978269..8c6153f 100644
--- a/bidb/settings/roles/local.py
+++ b/bidb/settings/roles/local.py
@@ -7,7 +7,6 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.pa
DEBUG = True
SITE_URL = 'http://127.0.0.1:8000'
-MEDIA_ROOT = os.path.join(BASE_DIR, 'storage')
DATABASES = {
'default': {
@@ -31,3 +30,7 @@ CACHES = {
BROKER_URL = 'memory://'
CELERY_ALWAYS_EAGER = True
CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
+
+MEDIA_URL = '/storage/'
+MEDIA_ROOT = os.path.join(BASE_DIR, 'storage')
+DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
diff --git a/requirements.txt b/requirements.txt
index 9fd8ea0..0670163 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,3 +12,5 @@ python-debian==0.1.28
chardet==2.3.0
django-keyerror==2.1.4
python-dateutil==2.6.0
+django-storages==1.5.2
+boto==2.45.0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/buildinfo.debian.net.git
More information about the Reproducible-commits
mailing list