python - django multiple templates nested extends
迷茫
迷茫 2017-06-30 09:52:46
0
1
779

There is now a page.
base.html
data.html

index.html

Now index.html extends base and blocks base information.
Here comes the problem. How to extend data.html? Django does not support the extends 2 syntax by default.

# index.html
{% extends "base.html" %}

{% block source %}

    {% extends "data.html" %}
    # 如何再继承一个模板然后渲染呢?
    # 如果这里 include data.html , view 传进来的context 不会生效
    
{% endblock %}

If you are new to Django, is it normal to need to render twice?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
迷茫

include with

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template