settings.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. INSTALLED_APPS += (
  2. 's3sync',
  3. 'redis_cache',
  4. )
  5. # This example is using redis as a cache backend
  6. # https://github.com/sebleier/django-redis-cache
  7. CACHES['s3-storage'] = {
  8. 'BACKEND': 'redis_cache.RedisCache',
  9. 'LOCATION': 'localhost:1234',
  10. 'TIMEOUT': 3600 * 24 * 30, # =30 days, in seconds
  11. 'OPTIONS': {
  12. 'DB': 2,
  13. }
  14. }
  15. MEDIA_ROOT = '/var/www/site/media'
  16. # Sync media
  17. BUCKET_ASSETS = 'example-static-bucket.yourdomain.com'
  18. BUCKET_ASSETS_PREFIX = 'media'
  19. BUCKET_UPLOADS = 'example-upload-bucket.yourdomain.com'
  20. BUCKET_UPLOADS_PREFIX = 'media/uploads'
  21. BUCKET_UPLOADS_PATH = MEDIA_ROOT + '/uploads'
  22. BUCKET_UPLOADS_URL = '//example-upload-bucket.yourdomain.com/media/'
  23. BUCKET_UPLOADS_CACHE_ALIAS = 's3-storage'
  24. BUCKET_UPLOADS_PENDING_KEY = 's3-pending'
  25. BUCKET_UPLOADS_PENDING_DELETE_KEY = 's3-pending-delete'
  26. # S3 Host/Region
  27. # To connect to your S3 host region, you may want to set this to avoid a BrokenPipeException
  28. # e.g. for EU, 's3-eu-west-1.amazonaws.com'
  29. AWS_S3_HOST = 's3.amazonaws.com'