Module csrf
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
source linkClasses
Functions
▶ def get_token(request) Return the CSRF token required for a POST form. The token is an alphanumeric value. A new token is created if one is not already set.
A side effect of calling this function is to make the csrf_protect
decorator and the CsrfViewMiddleware add a CSRF cookie and a 'Vary: Cookie'
header to the outgoing response. For this reason, you may need to use this
function lazily, as is done by the csrf context processor.
Reexports
▶ def rotate_token(request) Change the CSRF token in use for a request - should be done on login for security purposes.