我在Python Django中写下了这段代码,使用模板并获取错误。 我的Django版本:1.8.3
from django.shortcuts import render
from django.http import HttpResponse
from django.template.loader import get_template
from django.template import Context
def hello_template (request):
name = "Jatin"
t = get_template('hello.html')
html = t.render(Context({'name': name}, request))
return HttpResponse(html)
错误:
AttributeError at /hello_template/
'str' object has no attribute 'copy'