I’m developing an web app with Google app engine that uses jinja2 as a template engine.
I’m my base.html file i have a <link> tag for CSS.
Now i have a another file front.html that extends the first file . It has the {% extends 'base.html' %} block and the code is in a block {% block content %} ……. {% endblock %}.
In the second file, the CSS style won’t apply. Any ideas how to fix it ?
To be more precise:
base.html :
<head>
<link ... >
< /head>
<body>
{% block content %}
{% endblock %}
</body>
front.html:
{% extends 'base.html' %}
{% block content %}
....
{% endblock %}
The style from the tag won’t apply to the block.
Ok. I figured it out . The path to the
front.htmlwas something like/path1/path2while for thebase.htmlthe path was/path1. So it did not link corectly.As a solution you can make a block on the link tag and the override it something like:
{% block stylesheet %}<link href="path1/something.css">
{% endblock %}
and in the child you have
{% block stylesheet %}<link href="/path1/path2/something.css">
{% endblock %}
Or, you could put a path in the
app.yamlfile.