Django
hk_H
尽量做到免费开源,一起分享知识
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
django中间件-TypeError: 'TestMiddleware' object is not callable
class TestMiddleware(object): '''中间件类''' def __init__(self,request): '''服务器重启之后,接收第一个请求时调用''' print('----init----') def process_request(self, request): '''产生request对象之后,url匹配之前调用''' print('----process_request-..原创 2020-05-13 17:54:57 · 610 阅读 · 1 评论 -
Django异常,TypeError: context must be a dict rather than RequestContext.
def index(request): # 进行处理,和M和T进行交互。。。 # return HttpResponse("老头,没毛病") # 使用模板文件 # 1、加载模板文件 temp = loader.get_template('booktest/index.html') # 2定义模板文件上下文,给模板文件传递数据 contex...原创 2020-05-06 22:56:24 · 414 阅读 · 0 评论
分享