Django中间件process_template_response显示中间件响应,然后查看响应

时间:2018-11-14 07:13:30

标签: django django-templates django-views django-middleware

有没有一种方法,我首先通过获取视图上下文数据来显示中间件process_template_response响应,然后显示原始视图响应。

我已经定义了一个中间件,

def process_template_response(self, request, response):
    return render(request, 'accounts/form.html', {})

我的观点是,

def view_func(request, product_id):
    ...
    ... 
    return TemplateResponse(request, 'accounts/home.html', {})

0 个答案:

没有答案
相关问题