【发布时间】:2011-08-28 11:35:47
【问题描述】:
我正在尝试使用 Django 模板引擎或任何其他方式创建 动态 CSS 文件。
目前,我的 CSS 规则如下所示:
background-image: url('http://static.example.com/example.png');
其中http://static.example.com 对应于Python 中的STATIC_URL 变量。使用 Django 模板引擎,理论上我可以这样写:
background-image: url('{{ STATIC_URL }}example.png');
我的问题是,如何使用 Django 模板引擎(或任何其他方式)动态生成 CSS?
【问题讨论】:
标签: python css django templates django-templates