Advertisement
jrujano

Python JSON Escape HTML

Sep 20th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. import html
  2. rendered = render_to_string("notifications/template_con.html", context)
  3. string =html.escape(rendered)
  4.  
  5. payload ={
  6. "to": ",".join(emails),
  7. "subject": "Nuevo contrato ID:{}".format(instance.id),
  8. "body": "{}".format(string)
  9.  
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement