-3

I'm trying to learn programming and came across this in my core app.

from django.shortcuts import render
from django.views.generic import TemplateView
# Create your views here.

class SplashView(TemplateView):
    template_name = "index.html"

What specifically does the above class do, in this context?

rhn
  • 21
  • 2
  • Did you even try searching for yourself? –  Apr 23 '15 at 04:06
  • possible duplicate of [Python - Classes and OOP Basics](http://stackoverflow.com/questions/10004850/python-classes-and-oop-basics) – JSON C11 Apr 23 '15 at 04:09
  • This is not a good example for a beginner; this particular class is part of the Django framework and, as such, cannot be understood on its own, but rather in how the framework uses such a class. – chepner Apr 23 '15 at 04:33

1 Answers1

4

It does everything TemplateView does, plus has an attribute called "template_name" with the value of "index.html".

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358