Any way to make {% extends '…' %} conditional? - Django

前端 未结 4 760
长发绾君心
长发绾君心 2020-11-27 04:21

I would like to share a template between AJAX and regualr HTTP calls, the only difference is that one template needs to be served with the base.html html, the other one with

4条回答
  •  悲哀的现实
    2020-11-27 04:57

    {% extends override_base|default:'base.html' %}
    

    P.s. I know this is an old question, but I found it when searching for an answer. Maybe it'll help someone else with the same problem.

提交回复
热议问题