Django 1.4 and django-compressor strangeness
-
16-06-2021 - |
Question
I use django-compressor 1.1.2
with Django 1.4
when using compress
templatetags PROJECT_PATH
appended to STATIC_URL
after compression
/static/Users/sultan/.virtualenvs/mediabox/somedia/somedia/public/media/media-cache/compressor/css/1d7cd4216904.css
When I don't set COMPRESS_OUTPUT_DIR = os.path.join(MEDIA_CACHE, 'compressor')
Output looks like
/static/CACHE/css/1d7cd4216904.css
settings
STATICFILES_FINDERS = (
...
'compressor.finders.CompressorFinder'
)
COMPRESS_ENABLED = True
COMPRESS_OUTPUT_DIR = os.path.join(MEDIA_CACHE, 'compressor')
What is wrong with my configuration?
Thanks,
Sultan
Solution
According to the doc
django.conf.settings.COMPRESS_OUTPUT_DIR
Default : 'CACHE'
Controls the directory inside COMPRESS_ROOT that compressed files will be written to.)
I don't know what's your MEDIA_CACHE
setting here, but you don't need to join directories to generate COMPRESS_OUTPUT_DIR
, just give it a relative name such as 'compressor'
or 'cache'
to try.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow