#342 Add required options for S3 to production.py and added Env variable to enable/disable compression

This commit is contained in:
andresgz 2016-06-03 16:25:10 -04:00
parent feddb94eb7
commit a9fc0a919c
2 changed files with 12 additions and 0 deletions

View File

@ -150,6 +150,15 @@ STATICFILES_STORAGE = 'config.settings.production.StaticRootS3BotoStorage'
AWS_PRELOAD_METADATA = True
INSTALLED_APPS = ('collectfast', ) + INSTALLED_APPS
{%- endif %}
{% if cookiecutter.use_compressor == 'y'-%}
# COMPRESSOR
# ------------------------------------------------------------------------------
COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
COMPRESS_URL = STATIC_URL
COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
{%- endif %}
# EMAIL
# ------------------------------------------------------------------------------

View File

@ -24,3 +24,6 @@ DJANGO_OPBEAT_ORGANIZATION_ID
DJANGO_OPBEAT_APP_ID
DJANGO_OPBEAT_SECRET_TOKEN
{% endif %}
{% if cookiecutter.use_compressor == 'y' -%}
COMPRESS_ENABLED=
{% endif %}