Created
March 11, 2016 19:08
-
-
Save juanmhidalgo/662217d785cc876ea1cd to your computer and use it in GitHub Desktop.
[django] Render template to string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.template.loader import render_to_string | |
email_body = render_to_string("my_email_template.txt", { 'name': 'Bob', | |
'message': 'Hello!' }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment