Advertisement
Guest User

Parse HTML-JSON

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