Views.py:的Html不显示的Django
def index(request):
return HttpResponse(TemplateView.as_view(template_name="index1.html"))
urls.py:
url(r'^about/$', TemplateView.as_view(template_name="index1.html")),
url(r'^$', views.index, name='index'),
文件在同一目录1.10
来源对铬:
<function TemplateView at 0x00000000034A6E18>
给我服务器错误500 – ChrisEthanFox
@ChrisEthanFox你在控制台有什么错误?你有哪些模板? –
暂时我把它放在与view.py文件相同的目录下 – ChrisEthanFox