fmartingr
/
shelfzilla
Archived
1
0
Fork 0
This repository has been archived on 2021-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
shelfzilla/shelfzilla/context_processors.py

15 lines
320 B
Python

def pjax(request):
"""
Determines if a request if a pjax request by the X-PJAX header
"""
template = '_layout.html'
is_pjax = request.META.get('HTTP_X_PJAX', False)
if is_pjax:
template = '_pjax.html'
return {
'is_pjax': is_pjax,
'extends_template': template,
}