def GET(self): counter = random_count(1, 100) data = db.get_data(some_data) return render.index(**locals())
this code will generate error(it's perfectly legal on django). so i came up with this silly hack.
def mylocals(local): l = locals del l['self'] return l
so when i'm gonna send data to a template i use
l = mylocals(locals()) return render.index(**l)
it works with this hack, i'd send data via
return render.index(counter = counter, data = data) but why would anyone do this? it's more ease to write **locals().