title: How do I render a Django template as a string when using the include tag?
body: <p>Long story short, I am trying to include a Django template as a string, and I would like to do something like this in a script tag:</p>
  
  <pre><code>&lt;script&gt;
      var template = '{% include "mytemplate.html" %}';
  &lt;/script&gt;
  </code></pre>
  
  <p>Right now I keep getting an invalid or unexpected token error, with the following output:</p>
  
  <pre><code>var template = '&lt;h1&gt;Hello World&lt;/h1&gt;
  '
  </code></pre>
  
  <p>Which makes me wonder if there's some sort of newline character taking effect at the end? And it seems to be taking effect before I can do anything about it since things like .trim() don't seem to work.</p>