Enable SASS processor in production
In production environments (especially via Docker), the SCSS is compiled only one time at the start. The management command compilescss
have to be executed if theme variables have changed.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Jonathan Weth changed milestone to %2.0a2
changed milestone to %2.0a2
- Jonathan Weth added part::backend part::packaging labels
added part::backend part::packaging labels
- Owner
Why? The CSS is recompiled immediately when the config is changed (via a signal).
- Author Owner
But for the production env it must be compiled manually. The signal only deletes cached files.
Collapse replies - Owner
And then the sass processor recompiles it the next time a page is loaded. Why should a production environment be any different in that regard?
- Author Owner
Because the recompilation is triggered only if static files are served by Django (there must be a trigger somewhere). When the static files are provided by an extra web server like nginx it's not working. You can check django-sass-preprocessor's documentation.
- Owner
Isn't calling the
sass_src
template tag enough of a trigger? - Author Owner
Actually yes.
- Author Owner
OK, I found the problem: https://github.com/jrief/django-sass-processor/blob/9a5171244d5fe165ce073fbfd86a3e949e6ec777/sass_processor/processor.py#L38
SASS_PROCESSOR_ENABLED
is not provided through oursettings.py
. - Owner
That sounds very easily fixable ;).
- Author Owner
Yes, I will do it this evening.
- Nik | Klampfradler assigned to @hansegucker
assigned to @hansegucker
- Nik | Klampfradler added type::bug workflow::confirmed labels and removed part::packaging label
added type::bug workflow::confirmed labels and removed part::packaging label
- Nik | Klampfradler changed title from Recompile SCSS if theme variables have changed to Enable SASS processor in production
changed title from Recompile SCSS if theme variables have changed to Enable SASS processor in production
- Jonathan Weth created merge request !183 (merged) to address this issue
created merge request !183 (merged) to address this issue
- Jonathan Weth mentioned in merge request !183 (merged)
mentioned in merge request !183 (merged)
- Nik | Klampfradler closed via merge request !183 (merged)
closed via merge request !183 (merged)
- Nik | Klampfradler mentioned in commit 671c79f8
mentioned in commit 671c79f8