Skip to content

Commit

Permalink
place the assets dir in COMPRESS_OUTPUT_DIR
Browse files Browse the repository at this point in the history
fixes issue #37
  • Loading branch information
PhilipGarnero committed Jul 17, 2015
1 parent a48118f commit dce8555
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions django_pyscss/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit dce8555

Please sign in to comment.