From dce8555672d31a35e3712149d65a7e7f51e1bb6e Mon Sep 17 00:00:00 2001 From: Philip Garnero Date: Fri, 17 Jul 2015 18:30:42 +0200 Subject: [PATCH] place the assets dir in COMPRESS_OUTPUT_DIR fixes issue #37 --- django_pyscss/compiler.py | 6 ++++-- tests/test_scss.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/django_pyscss/compiler.py b/django_pyscss/compiler.py index cf20595..444f8e5 100644 --- a/django_pyscss/compiler.py +++ b/django_pyscss/compiler.py @@ -22,9 +22,11 @@ config.STATIC_URL = staticfiles_storage.url('scss/') # This is where PyScss places the sprite files. -config.ASSETS_ROOT = os.path.join(settings.STATIC_ROOT, 'scss', 'assets') +config.ASSETS_ROOT = os.path.join(settings.STATIC_ROOT, + settings.COMPRESS_OUTPUT_DIR, 'assets') # PyScss expects a trailing slash. -config.ASSETS_URL = staticfiles_storage.url('scss/assets/') +config.ASSETS_URL = staticfiles_storage.url(settings.COMPRESS_OUTPUT_DIR + + '/assets/') class DjangoScssCompiler(Compiler): diff --git a/tests/test_scss.py b/tests/test_scss.py index f76b3e7..c90c93c 100644 --- a/tests/test_scss.py +++ b/tests/test_scss.py @@ -150,4 +150,4 @@ def test_sprite_images(self): actual = self.compiler.compile_string(SPRITE_MAP) # pyScss puts a cachebuster query string on the end of the URLs, lets # just check that it made the file that we expected. - self.assertTrue(re.search(r'url\(/static/scss/assets/images_icons-.+\.png\?_=\d+', actual)) + self.assertTrue(re.search(r'url\(/static/CACHE/assets/images_icons-.+\.png\?_=\d+', actual))