Python - How to import 'render_to_string' -- django

Import render_to_string

To import render_to_string, Add the following line to the top of your code.

from django.template.loader import render_to_string

 

For more information about render_to_string:
django render_to_string