Python Web开发:制作门户网站准备工作

来自CloudWiki
跳转至: 导航搜索

准备工作

编写视图函数

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


# Create your views here.
def science(request):    
    return render(request,'science.html')


模板文件

Science目录下新建templates

在templates下新建science.html