Reputation: 315
I am stuck at some beginner level concept of django. I am so much unable to understand documentation of TemplateView
.
In following sample of code:
class ProductView(TemplateView):
template_name = "product.html"
Form just template_name
how django render html page. I mean is template_name
is reserved keyword? What if I write template_name1
instead of it will it work? And I am not returning anything how this single doing all things.
Upvotes: 1
Views: 28
Reputation: 46
This website has it all https://ccbv.co.uk/ And why it's not returning anything ? That's the point of class based views It does all the magic for you so you dont need to worry about it. Well if you actually want to worry You can use functions instead or browse the website above and you will know what magic I'm talking about
Upvotes: 1