8.2.10.4.4.1. CSRF

class CSRF(app=None)[source]

Methods

__delattr__

Implement delattr(self, name).

__dir__

Default dir() implementation.

__eq__

Return self==value.

__format__

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__getstate__

Helper for pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

__init_subclass__

This method is called when a class is subclassed.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

Return self!=value.

__new__

__reduce__

Helper for pickle.

__reduce_ex__

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__

Size of object in memory, in bytes.

__str__

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_error_response

_get_csrf_token

add_auto_refresh_header

exempt

Mark a view or blueprint to be excluded from CSRF protection.

generate_csrf_token

init_app

protect

setup_form

Receive the form we're attached to and set up fields.

validate_csrf_token

__init__(app=None)

Attributes

__annotations__

__dict__

__doc__

__module__

__weakref__

list of weak references to the object

setup_form(form)[source]

Receive the form we’re attached to and set up fields.

The default implementation creates a single field of type field_class with name taken from the csrf_field_name of the class meta.

Parameters:

form – The form instance we’re attaching to.

Returns:

A sequence of (field_name, unbound_field) 2-tuples which are unbound fields to be added to the form.

generate_csrf_token(csrf_token_field)[source]
validate_csrf_token(form, field)[source]
protect()[source]
add_auto_refresh_header(resp)[source]
init_app(app)[source]
__annotations__ = {}
__doc__ = None
__module__ = 'schedula.utils.form.server.csrf'