I'd use render_to_string here and put this html in a django template file.