You need to include quotes in your expression, I think. You can use the json module to output valid JavaScript letters:
dict(field_name=json.dumps('geom'))
and in your template:
init_map( ${field_name | n} );
Then the quotes are generated by the .dumps() function, and the filter | n | n ensures that they are not shielded; You have already made your values ββsafe JavaScript, you also do not need these HTML files.
An added benefit is that the module will also escape any quotes in your JavaScript values ββand handle unicode correctly:
>>> import json >>> print json.dumps(u'Quotes and unicode: " \u00d8') "Quotes and unicode: \" \u00d8"
source share