Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add header info in django response

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #header #info #django #response
ADD COMMENT
Topic
Name
7+5 =