3👍
✅
request.META
is a dictionary, so you simply do:
self.request.META['HTTP_REFERER'] = '/example/uri/here/'
I’m not sure why you would want to do this. Note that the original header will contain the domain.
1👍
In your view’s response
, you can set or modify HTTP header fields:
response = HttpResponse()
response['REFERER'] = '/example/uri/here/'
return response
- [Django]-Override django admin activity log
- [Django]-Django Queryset Filter Missing Quotes
- [Django]-Exception Type: MultiValueDictKeyError when send POST request
- [Django]-How to put a value from request.GET as a hidden input in django-crispy-forms
Source:stackexchange.com