I am having a method in views.py as follows:
def index(self, request): initial = get_initial() context = {\"context\" : initial_topics} template = lo
If the javascript code lies in the html template being rendered, you can use it in the normal way {{ context }}. Else, declare a global in the html template and access that global from your separate js file.
{{ context }}