class ContextMixin

from django.views.generic.base import ContextMixin
Hierarchy diagram Documentation Source code
A default context mixin that passes the keyword arguments received by
get_context_data() as the template context.

Attributes

  Defined in
__firstlineno__ = 23 ContextMixin
__static_attributes__ = () ContextMixin
extra_context = None ContextMixin
Expand Collapse

Methods

def get_context_data(self, **kwargs): ContextMixin

31
32
33
34
35
def get_context_data(self, **kwargs):
    kwargs.setdefault("view", self)
    if self.extra_context is not None:
        kwargs.update(self.extra_context)
    return kwargs