Set COMPRESS_ROOT to STATIC_ROOT for compressor

Django compressor also recommends the `COMPRESS_ROOT` be the STATIC_ROOT. This also makes sure the utils is set up properly so that the CACHE directory is actually publicly available (it'll be inside the static directory as a subdirectory).
This commit is contained in:
Andrew Chen Wang 2020-08-13 10:13:40 -04:00 committed by GitHub
parent 55d3d95333
commit 1cb2a0c98e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,6 +242,7 @@ COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
COMPRESS_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
{%- elif cookiecutter.cloud_provider == 'AWS' or cookiecutter.cloud_provider == 'GCP' %}
COMPRESS_STORAGE = STATICFILES_STORAGE
COMPRESS_ROOT = STATIC_ROOT
{%- elif cookiecutter.cloud_provider == 'None' %}
COMPRESS_STORAGE = "compressor.storage.GzipCompressorFileStorage"
{%- endif %}