Skip to content

Commit dce8555

Browse files
committed
place the assets dir in COMPRESS_OUTPUT_DIR
fixes issue #37
1 parent a48118f commit dce8555

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

django_pyscss/compiler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
config.STATIC_URL = staticfiles_storage.url('scss/')
2323

2424
# This is where PyScss places the sprite files.
25-
config.ASSETS_ROOT = os.path.join(settings.STATIC_ROOT, 'scss', 'assets')
25+
config.ASSETS_ROOT = os.path.join(settings.STATIC_ROOT,
26+
settings.COMPRESS_OUTPUT_DIR, 'assets')
2627
# PyScss expects a trailing slash.
27-
config.ASSETS_URL = staticfiles_storage.url('scss/assets/')
28+
config.ASSETS_URL = staticfiles_storage.url(settings.COMPRESS_OUTPUT_DIR +
29+
'/assets/')
2830

2931

3032
class DjangoScssCompiler(Compiler):

tests/test_scss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ def test_sprite_images(self):
150150
actual = self.compiler.compile_string(SPRITE_MAP)
151151
# pyScss puts a cachebuster query string on the end of the URLs, lets
152152
# just check that it made the file that we expected.
153-
self.assertTrue(re.search(r'url\(/static/scss/assets/images_icons-.+\.png\?_=\d+', actual))
153+
self.assertTrue(re.search(r'url\(/static/CACHE/assets/images_icons-.+\.png\?_=\d+', actual))

0 commit comments

Comments
 (0)