I am working on a view called hero:
def hero(request):
rfc='some value'
depends_on=1234
result_set = {'rfc': rfc, 'depends_on': depends_on}
return HttpResponse(json.dumps(result_set))
Now, I want to pass the values of rfc and depends_on from this view to a template as JavaScript variables. This will allow me to use these variables to populate some fields in that template. How can I achieve this?
Your assistance is greatly appreciated.