Django[11]模板Template context和Bootstrap使用
视图views.py中 : 1234567891011121314151617181920212223242526 from __future__ import unicode_literalsfrom django.shortcuts import render# Create your views here.from django.http import HttpResponsedef (request): context = { "title": "home" } return render(request,"index.html",context)def posts_create(request): context = { "title": "create" } return render(request,"index.html",context)def posts_detail(request): context = { "title": "detail" } return render(request,"index.html",context) index.html中 用 context 去 大专栏 Django[11]模板Template context和Bootstrap使用 填充模板 index.html,然后再返回 index.html中添加如下代码: 1