Source

django-template-project / source / apps / main / views.py

# -*- encoding:utf-8 -*-
"""
Common main-app views
"""
from django.views.generic.base import TemplateView

class HomeView(TemplateView):
    template_name = "main/home.html"

    def get_context_data(self, **kwargs):
        data = super(HomeView, self).get_context_data(**kwargs)
        data["current_page"] = "home"
        return data

home_view = HomeView.as_view()