Skip to content

Commit a5ca3b1

Browse files
committed
fix up s3.
1 parent 76cc01b commit a5ca3b1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Django==1.4.1
22
Genshi==0.6
33
dj-database-url==0.2.1
44
django-extensions==0.9
5+
django-storages==1.1.5
56
feedparser==5.1.2
67
gevent==0.13.8
78
greenlet==0.4.0

settings.py

+11
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@
7878
'join',
7979
'django_extensions',
8080
'gunicorn',
81+
'storages',
8182
)
8283

84+
8385
GOOGLE_MAPS_API_KEYS = {
8486
'tolerance.markng.co.uk': 'ABQIAAAARLoA22nEYHR0NvOy5PhlABQCULP4XOMyhPd8d_NrQQEO8sT8XBRcnzN6opBIDWJu1LZNj_pwrPsp8A',
8587
'dotdorset.org': 'ABQIAAAARLoA22nEYHR0NvOy5PhlABRzb6WlbTpBFu4KRv6X5rYmMGQeVxTcZCqq-phTHsx_Nm7TzbnRRsEd_A',
@@ -89,3 +91,12 @@
8991
from localsettings import *
9092
except Exception, e:
9193
pass
94+
95+
96+
if not DEBUG:
97+
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
98+
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
99+
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', None)
100+
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', None)
101+
AWS_STORAGE_BUCKET_NAME = os.environ.get('AWS_STORAGE_BUCKET_NAME', None)
102+
STATIC_URL = 'http://du6kqsgpwn58q.cloudfront.net/'

urls.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.conf.urls.defaults import *
22
from django.contrib import admin
3+
from django.conf import settings
34
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
45
from aggregator.feed import FullFeed, CategoryFeed
56
feeds = {
@@ -12,7 +13,6 @@
1213
(r'^join/$', 'join.views.index'),
1314
(r'^admin/', include(admin.site.urls)),
1415
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
15-
(r^static/(?P.*)$’, ‘django.views.static.serve’, {‘document_root’: settings.STATIC_ROOT}), # we SHOULDN'T DO THIS, but I'm not paying for S3 storage for this, too. :)
1616
)
1717

1818
urlpatterns += staticfiles_urlpatterns()

0 commit comments

Comments
 (0)