Custom HTTP Header in Django

Go ahead and use:

request.META.get('HTTP_{your uppercased header name}')

Note in Django you write the header name in capitals with underscores instead of dashes, but in the request on the client you must write it using dashes instead of underscores (production web servers will strip out custom headers with underscores in them for security reasons).

So, a custom header My-Custom-Header is accessed request.META['HTTP_MY_CUSTOM_HEADER']


Finally I found just get it through

request.META('HTTP_{your uppercased header name}')

Tags:

Django