django-模板之自动转义autoescape(八)

时间:2022-07-23
本文章向大家介绍django-模板之自动转义autoescape(八),主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

index.html

{{QQ}}

views.py

def index(request):
    context={
        'QQ':'<a href="http://www.qq.com">QQ</a>'
    }
    return render(request,"index.html",context=context)