You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few things I've found while looking how Cabot organizes the static files:
the dependency on Less.js exists for a small file (base.less) which could easily be committed compiled
the use of django-compressor's compress blocks are used a lot for little gain
the static files should be shipped pre-compiled, compressed and collected with the Docker image, ready to be served
I'd like to propose (and contribute) some steps that could simplify the setup:
move to django-pipeline which uses Django's staticfiles app and has compiler and compression support built in
remove Less.js dependency by compiling base.less to base.css and commit it
move coffescript blocks into own files under cabot/static/js/<template-name>.js, e.g. cabot/static/js/service-list.coffee, which is included with a script tag in cabot/templates/cabotapp/service_list.html
start to use whitenoise as a way to serve the resulting compiled, collected and compressed static files
call collectstatic to trigger this whole thing in the Dockerfile to bake the static files into the image, fewer moving parts during deployment
I'm wondering if I'm missing something obvious, but I think this would be a big win for Cabot. In terms of reference that I can pull this off, I wrote django-staticfiles and co-wrote django-compressor. Please let me know if you're interested in that direction.
The text was updated successfully, but these errors were encountered:
I think this sounds amazing @jezdez - I haven't seen whitenoise before but it looks like a godsend. The whole code layout wasn't thought through well and any reorganization would be gratefully received.
There are a few things I've found while looking how Cabot organizes the static files:
I'd like to propose (and contribute) some steps that could simplify the setup:
cabot/static/js/<template-name>.js
, e.g.cabot/static/js/service-list.coffee
, which is included with a script tag incabot/templates/cabotapp/service_list.html
collectstatic
to trigger this whole thing in theDockerfile
to bake the static files into the image, fewer moving parts during deploymentI'm wondering if I'm missing something obvious, but I think this would be a big win for Cabot. In terms of reference that I can pull this off, I wrote django-staticfiles and co-wrote django-compressor. Please let me know if you're interested in that direction.
The text was updated successfully, but these errors were encountered: