title: django: access elements from another template
body: <pre><code>project/
  |----app1/
       |----templates/
                     app1/                       
                     |----home.html
                     |----exchange.html
  </code></pre>
  
  <p>I need to perform calculations on the home.html using javascript, but some data is stored in the table inside exchange.html, and I don't want to put them together under one page. how would I go about that. I am very new to python and django.</p>
  
  <pre><code>{% include "exchange.html" %}
  </code></pre>
  
  <p>I tried this on home.html but it loads all the content which i don't need. can anybody help please.</p>
  
  <pre><code>&lt;table class="table table-hover"&gt;
          &lt;caption&gt;Exchange rate&lt;/caption&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;GBP&lt;/th&gt;
                  &lt;th&gt;EUR&lt;/th&gt;
                  &lt;th&gt;USD&lt;/th&gt;
                  &lt;th&gt;CAD&lt;/th&gt;
                  &lt;th&gt;AUD&lt;/th&gt;
              &lt;/tr&gt;       
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td&gt;GBP&lt;/td&gt;
                  &lt;td&gt;&lt;input type="number" value="1" readonly&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
              &lt;/tr&gt;                   
              &lt;tr&gt;
                  &lt;td&gt;EUR&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="number" value="1" readonly&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
              &lt;/tr&gt;
                  &lt;td&gt;USD&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="number" value="1" readonly&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
              &lt;tr&gt;
                  &lt;td&gt;CAD&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="number" value="1" readonly&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;AUD&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input class="rate" type="number"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="number" value="1" readonly&gt;&lt;/td&gt;
              &lt;/tr&gt;           
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>I have this table in exchage.html where users can input the exchange rate, and I need to to do some calculation on home.html using the relevant rate.</p>