首页 > 解决方案 > django cookiecutter 在 docker 中编译 sass

问题描述

我正在使用 docker 在本地运行cookiecutter-django。如何编译 sass?

我通过做来运行应用程序$ docker-compose --file local.yml up当我编辑源代码模板文件时,Web 应用程序会在http://localhost:8000反映这些更改

当我编辑static/sass/project.scss网站时没有得到新的 CSS 规则。

我试着跑步$ docker-compose --file local.yml run --rm npm install,但我得到了消息ERROR: No such service: npm

可能有帮助的资源:

  1. https://cookiecutter-django.readthedocs.io/en/latest/live-reloading-and-sass-compilation.html

  2. https://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html#building-running-production-stack

标签: djangodockersasscookiecutter-django

解决方案


服务名称(来自 docker-compose 文件是node.
命令应该是$ docker-compose --file local.yml run --rm node npm install


推荐阅读