Skip to content

Commit

Permalink
Use whitenoise and https for media on production
Browse files Browse the repository at this point in the history
  • Loading branch information
coagulant committed Feb 17, 2015
1 parent 285a28e commit 7ed6aa9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions moscowdjango/settings_production.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
AWS_STORAGE_BUCKET_NAME = 'moscowdjango'
AWS_QUERYSTRING_AUTH = False
AWS_CALLING_FORMAT = 2 # SUBDOMAIN
AWS_S3_SECURE_URLS = True

# Media & static
DEFAULT_FILE_STORAGE = 'moscowdjango.amazon.DefaultStorage'
STATICFILES_STORAGE = 'moscowdjango.amazon.StaticStorage'
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
DEFAULT_S3_PATH = "media"
STATIC_S3_PATH = "static"
MEDIA_ROOT = '/%s/' % DEFAULT_S3_PATH
Expand All @@ -28,4 +29,4 @@
COMPRESS_URL = 'https://%s.s3.amazonaws.com/static/' % AWS_STORAGE_BUCKET_NAME
COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
COMPRESS_ROOT = '/static/'
COMPRESS_OUTPUT_DIR = 'CACHE'
COMPRESS_OUTPUT_DIR = 'CACHE'

0 comments on commit 7ed6aa9

Please sign in to comment.