HTML未附加到DJANGO请求中的HTML

我正在尝试从Django视图中将一些html附加到我的index.html模板上。

这是我的views.py

 from django.shortcuts import render
 from django.http import HttpResponse

 from .models import Greeting

 # Create your views here.
 def index(request):

     # return HttpResponse('Hello from Python!')
     return render(request,"index.html",{'index': "<div> dfdafadfasdsad </div>"})

但是,它只是输出index.html而不添加html。我在做什么错了?

caoyangcui 回答:HTML未附加到DJANGO请求中的HTML

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3084212.html

大家都在问