SHARE
TWEET

Python JSON Escape HTML

jrujano Sep 20th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top