About Passing HTML Content to an Iframe

Without JavaScript, you can pass the HTML content to an iframe using the srcdoc attribute.

1
<iframe srcdoc="{{ obj.get_preview_html }}" />

Tips and Tricks Programming Django 4.2 Django 3.2 Django 2.2 Django 1.11 Django 1.8 HTML5