title: Call a Django View function on button click in Html form, using form action
body: <p>I'm trying to make a basic function in Django, but I don't know how to call the function in <code>views.py</code> from the template when a button is clicked.
  I did find a similar question <a href="https://stackoverflow.com/questions/48438575/call-django-on-html-button-click/48438962">here</a>.
  But <code>actionUrl</code> confused me a lot, and I am not sure how to implement it.</p>
  
  <p>Button code in template:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form action ="{% check1 %}"  method = "POST"&gt;
      {% csrf_token %}
      &lt;button type='submit'&gt; True&lt;/button&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Currently I have commented out the actual logic of the function and am just trying to get it to respond so it's here:</p>
  
  <pre><code>def check1(request):
    return HttpResponse("why u no work")
  </code></pre>
  
  <p><code>urls.py</code>:</p>
  
  <pre><code>urlpatterns = [
   path('', Posts, name='Posts'),
   path('', index, name = 'index'),
   path('', check1, name = 'check1'),
   #path(actionUrl, views.check1),
  ]
  </code></pre>