title: How to call function from template With Django
body: <p>Please let me know in Django how to call method written from template html to view.
  Also please tell me about how to pass variables.</p>
  
  <pre><code>class index(TemplateView):
      template_name = "index.html"
  
      def get(self, request, *args, **kwargs):
          text = "text"
          return render(request, self.template_name, {'text': text})
  
  def Replace
      text = "Replaced"
      (I want to pass variable text to index html from here)
  </code></pre>
  
  <p>index.html is as follows</p>
  
  <pre><code>&lt;p&gt;{{ text }}&lt;p&gt;
  &lt;a html="{?????}"&gt;text replace&lt;/&gt;
  </code></pre>
  
  <p>If you click "text replace" you want to call the function "Replace" to replace the variable "text".
  Though it is a rudimentary question, thank you.</p>