21 lines
581 B
Python
21 lines
581 B
Python
from typing import Any
|
|
|
|
from django.core.handlers.wsgi import WSGIRequest
|
|
from django.http import HttpResponse
|
|
from django.views.generic import TemplateView
|
|
|
|
|
|
class DemoViewBase(TemplateView):
|
|
active_section = None
|
|
title = None
|
|
|
|
def get_context_data(self, **kwargs) -> dict[str, Any]:
|
|
return {
|
|
"title": self.title,
|
|
"active_section": self.active_section,
|
|
}
|
|
|
|
def get(self, request: WSGIRequest, *args, **kwargs) -> HttpResponse:
|
|
context = self.get_context_data(**kwargs)
|
|
return self.render_to_response(context)
|