📜  Django 中的请求标头 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:30.835000             🧑  作者: Mango

代码示例2
def home_page(request):
    # get the django.http.response.HttpResponse object
    resp = render(request, 'dept_emp/home_page.html')
    # set http response header and value.
    resp['Cache-Control'] = 'public,max-age=100000'
    resp['Vary'] = 'Accept-Encoding'
    # return the HttpResponse object. 
    return resp