为什么我的Django将原始CSS载入html文件?

时间:2018-08-12 20:06:04

标签: django django-1.4 django-compressor django-pipeline

我有一个使用django-pipeline和django-compress设置的Django项目。 github上的代码非常标准,例如:

{% extends "base.html" %}
{% load static from staticfiles %}

{% block extra_head %}
<meta name="description" content="Company Desc">
<meta name="keywords" content="kw1, kw2, kw3, kw4">
<meta property='og:title' content='Company title'/>
<meta property='og:image' content="{% static 'images/image.png' %}"/>
<meta property='og:description' content='our motto'/>
<meta property='og:url' content='https://www.company.com' />
{% endblock extra_head %}

但是当我从github克隆代码并以崇高或pycharm样式打开它时,由于某种原因,它被注入到我的html头中,我无法弄清原因。我们正在使用Django 1.4,django-pipeline,django-compressor。

{% extends "base.html" %}
{% load static from staticfiles %}

{% block extra_head %}
<meta name="description" content="Company Desc">
<meta name="keywords" content="kw1, kw2, kw3, kw4">
<meta property='og:title' content='Company title'/>
<meta property='og:image' content="{% static 'images/image.png' %}"/>
<meta property='og:description' content='our motto'/>
<meta property='og:url' content='https://www.company.com' />
<style>
 //30 lines of compressed css.
</style>
{% endblock extra_head %}

有人知道css注入.html文本文件的原因吗?

0 个答案:

没有答案