When I render a page using the Django template renderer, I can pass in a dictionary variable containing various values to manipulate them in the page using {{ myVar }}
Note, that if you want to pass a variable to an external .js script then you need to precede your script tag with another script tag that declares a global variable.
data
is defined in the view as usual in the get_context_data
def get_context_data(self, *args, **kwargs):
context['myVar'] = True
return context