Genericviews and use template view

How to use context in generic views along with JSON file and how to dispaly template views?

Hello Pradhyumna, if you are taking about the dictionary context that we define inside the views, yes we can use them in template vies but what do you mean by JSON file ?? Pls try to give an ex. what do you want to do exactly ?

Like is it necesarry to create json every time to pass a context?

Ok I got your doubt actually that is dictionary in python although syntax is similar to json and yes we need to create it everytime if we want to pass some info in the templates.

can you help in that thing? I tried searching

class ___(templateview)

i guess something like this?
we create a json file ?
how do we pass this in context?

Yes pls tell what exactly do you want me to tell. See that explicitly don’t create any file in the views.py we define the context = {…} and then we send that view to a particular template and then we need to use those defined variables. We define those variables parameters within the view and pls don’t consider it as a json file it is a dictionary in python.

You can share the photos or code I have given you the no.