Using escapejs django utility to properly escape the single quotes for the json string