我有一个看起来像这样的字符串
string '''
<html>
<head>
{% block head %}{% endblock %}
... other stuff ...
</head>
<body>
{% block body %}{% endblock %}
... other stuff ...
</body>
</html>
'''
我希望你能帮忙翻译以下django模板,让它继承上面的字符串:
{% block head %}
... other stuff ...
{% endblock %}
{% block body %}
<h1>Other stuff</h1>
{% endblock %}
由于该字符串不在文件中,因此无法将其文件名指定给模板渲染引擎。有什么想法吗?