Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取get_模板Python中的错误_Python_Templates_Django Templates - Fatal编程技术网

获取get_模板Python中的错误

获取get_模板Python中的错误,python,templates,django-templates,Python,Templates,Django Templates,我已经用PythonDjango写下了这段代码,以使用模板和获取错误。 我的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): na

我已经用PythonDjango写下了这段代码,以使用模板和获取错误。 我的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'