File: context_processors.py

package info (click to toggle)
python-django-csp 3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 300 kB
  • sloc: python: 935; makefile: 135; sh: 6
file content (4 lines) | stat: -rw-r--r-- 124 bytes parent folder | download
1
2
3
4
def nonce(request):
    nonce = request.csp_nonce if hasattr(request, "csp_nonce") else ""

    return {"CSP_NONCE": nonce}