title: rendered script display inside body template django
body: <p>Sorry for my bad english.
  I use</p>
  
  <pre><code>{% ishout.js %}
  </code></pre>
  
  <p>inside <strong>head</strong> to render scripts file in django template but they display as string</p>
  
  <pre><code>"&lt;script type="text/javascript" src="http://localhost:5500/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://localhost:5500/client/ishout.client.js"&gt;&lt;/script&gt;"
  </code></pre>
  
  <p>and inside <strong>body</strong> not inside <strong>head</strong>.
  And other scripts after that are displayed in body too.</p>
  
  <p>I searched and find out by encoding but i cannot find how to fix it.</p>
  
  <p><strong>UPDATE</strong>
  This is views.py file</p>
  
  <pre><code>@login_required
  def home(request):
      users = User.objects.exclude(id=request.user.id)
      v = RequestContext(request, {'users':users})
      # return render(request, 'home.html', {'users':users})
      return render_to_response('home.html', v)
  </code></pre>
  
  <p>This is home.html file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;Home&lt;/title&gt;
      {% load drealtimetags %}
      {% ishout_js %}
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Dashboard&lt;/h1&gt;
      {% for user in users %}
          {{ user.first_name }}&lt;a href="/alert/?user={{ user.id }}"&gt;Alert (Hello)&lt;/a&gt;
      {% empty %}
          &lt;b&gt;No user found&lt;/b&gt;
      {% endfor %}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>UPDATE 2:</strong>
  This is page source</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;Home&lt;/title&gt;
  
  
      &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://localhost:5500/socket.io/socket.io.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
      &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://localhost:5500/client/ishout.client.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
  
      &lt;script&gt;
          ishout.on('alertchannel', function(data){
              alert(data.msg);
          });
  
          ishout.init();
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Dashboard&lt;/h1&gt;
  
          phuc&lt;a href="/alert/?user=2"&gt;Alert (Hello)&lt;/a&gt;
  
          &lt;a href="/alert/?user=3"&gt;Alert (Hello)&lt;/a&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And when I inspect</p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Home&lt;/title&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
  &amp;lt;script type="text/javascript" src="http://localhost:5500/socket.io/socket.io.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type="text/javascript" src="http://localhost:5500/client/ishout.client.js"&amp;gt;&amp;lt;/script&amp;gt;
  
      &lt;script&gt;
          ishout.on('alertchannel', function(data){
              alert(data.msg);
          });
  
          ishout.init();
      &lt;/script&gt;
  
  
      &lt;h1&gt;Dashboard&lt;/h1&gt;
  
          phuc&lt;a href="/alert/?user=2"&gt;Alert (Hello)&lt;/a&gt;
  
          &lt;a href="/alert/?user=3"&gt;Alert (Hello)&lt;/a&gt;
  
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p><a href="https://i.stack.imgur.com/H4q1r.png" rel="nofollow noreferrer">Snapshot</a></p>