Weird deployment issue with Django and CoffeeScrip

2019-06-24 12:08发布

This is sort of a complex question so it will take a bit to explain. I'm not looking for a direct answer so any advice would be good. I have a Django app that uses a lot of CoffeeScript. To compile the CoffeeScript in the project I am using the app django-compressor. To use django-compressor I need to install nmp (node package manager). Unfortunately, I can't install npm on Heroku. Thus, I need to compile the CoffeeScript before it hits the Heroku servers. So I did that by setting up Fabric which is seeming to work well.

I am running into a problem no because I can get the compiled CoffeeScript as a static file but the templates still have the {% compress js %} *** {% endcompress %} tags in them because django-compressor does not regenerate new templates until run time.

Thus I am looking for advice on how to deploy the app to get ride of the template tags so that the app can be deployed on Heroku. I know it is a question with a lot of parts so any piece of advice would be super helpful!

2条回答
Juvenile、少年°
2楼-- · 2019-06-24 12:31
欢心
3楼-- · 2019-06-24 12:35

you could also commit the manifest.json file that django compressor generates (I'm assuming you're using it in offline mode) and then it will know which template blocks go to which compiled js/css files

查看更多
登录 后发表回答