请问,django中怎么写view文件呢
1 回答
莼羹鲈鲙非吾好
TA贡献2条经验 获得超2个赞
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def getform(request):
context = {}
context['hello'] = 'Hello World!'
return render(request, 'temp.html', context)
def getHellworld(request):
return HttpResponse('hello world')
添加回答
举报
0/150
提交
取消