title: Django add function to button in template
body: <p>I dont know how can I add function from <code>views.py</code> to atribute action in my template.
  I'd like when I click the button then my page refreshes and add comment to datebase.</p>
  
  <p>Part of my template:</p>
  
  <pre><code>    &lt;form action = '???' method = "post"&gt;
      {{ formularz.as_p}}
      &lt;input type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Part of <code>views.py</code>:</p>
  
  <pre><code>def ShowNewses(request):
      newses = News.objects.filter(status = 'p')
      return render_to_response('news.html', {'news_set': newses})
  
  def ArchiveNews(request,topic,year, month, day):
      news = News.objects.filter(date__year = int(year), date__month = int(month), date__day = int(day),topic = topic)
      comments = Comments.objects.all()
      formularz = CommentsForm()
      return render_to_response('knews.html', {'news': news[0],'comments': comments, 'formularz': formularz}) 
  
  def AddComment(request):
      L = request.META['PATH_INFO'].split('/')
      if request.POST:    
      k = CommentsForm(request.POST)
      k.save()
      return HttpResponseRedirect(reverse('ArchiveNews', kwargs = {'request' = request, 'year' = L[3], 'month' = L[4], 'day' = L[5]}))
  </code></pre>
  
  <p><code>AddComment</code> is function which I want in my button.
  <code>ArchiveNews</code> is induced when I choose news which will be in new page.</p>
  
  <p><strong>EDIT</strong><br>
  part of <code>urls.py</code>:</p>
  
  <pre><code>url(r'^news/$', ShowNewses),
  url(r'^news/(?P&lt;topic&gt;.+)/(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\d{2})/(?P&lt;day&gt;\d{2})', ArchiveNews),
  </code></pre>
  
  <p>I updated here part of <code>views.py</code>. I added <code>ShowNewses</code>.</p>