Overview
CsrfMiddleware protects forms by validating tokens on POST requests and placing new tokens in the request.
Usage
Do's
- Include the token from the request in every form
- Check request['error'] for validation failures
Don'ts
- Reuse a token when single-use is enabled
- Remove tokens before rendering the view