title: How to pass raw <html> to xxx.html using dictionary values in python django
body: <p>After collecting some data in html format I need to display it on base.html using views.py render function. But it shows the raw code instead of showing the proper  view (select dropdown).</p>
  
  <p>I'm using django python on windows pc  </p>
  
  <p><code>models.py</code></p>
  
  <pre><code>class query(models.Model):
  
      connection = mysql.connector.connect(host="localhost",database="ameya",user="root",password="")
      html = '&lt;table class="table table-bordered datatable responsive" id="table-2"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Schedule NO.&lt;/th&gt;&lt;th&gt;Farmer Name&lt;/th&gt;&lt;th&gt;University&lt;/th&gt;&lt;th&gt;District&lt;/th&gt;&lt;th&gt;Taluk&lt;/th&gt;&lt;th&gt;Panchayet&lt;/th&gt;&lt;th&gt;Village&lt;/th&gt;&lt;th&gt;Crop&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody id="tab_tbody"&gt;'
  
      def __str__(self):     
          htm = '&lt;form action="getFarmer" method="post"&gt;&lt;select class="form-control" name="season"&gt;&lt;option value="0"&gt;-- Select Year --&lt;/option&gt;&lt;option value="333"&gt;All Data&lt;/option&gt;'
          now = datetime.datetime.now()
          cdt = now.year
          for i in range( 2017,int(cdt) ):
              htm += '&lt;option value="'+str(i)+'"&gt;'+str(i)+' - '+str(int(i)+1)+'&lt;/option&gt;'
          htm += '&lt;/select&gt;&lt;input type="submit" value="Search &gt;"&gt;&lt;/form&gt;'   
          return htm
  </code></pre>
  
  <p><code>views.py</code></p>
  
  <pre><code>def index(request):
      t = query()
      return render(request,"mainapp/base.html",{'html':t})
  </code></pre>
  
  <p><code>base.html</code></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;AmeyaKrishi Version 2&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
      &lt;h2&gt;AmeyaKrishi V2 (testing mode): All University Filter&lt;/h2&gt;&lt;hr&gt;
      &lt;p&gt;{{ html }}&lt;/p&gt;   
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>OUTPUT</p>
  
  <p><a href="https://i.stack.imgur.com/kIAlo.png" rel="nofollow noreferrer">local server output</a></p>