title: Django Beginner Forms, not able to make two forms work on one template page
body: <p>I would like to have more than one form on a page. So far I have a simple form that a user enters numbers and gets a number returned. When I trying to add another form (which will be Post2 in my models) on the same page I cant. I end up getting the same form twice.</p>
  
  <p>All help appreciated.</p>
  
  <p>Made an edit adding in an attempt to get second form working
  urls.py    </p>
  
  <pre><code>from django.conf.urls import  url
  from django.contrib import admin
  from amat.views import AmatView
  
  from . import views
  
  urlpatterns = [
      url(r'^$', AmatView.as_view(), name='home'),
  
      ]
  </code></pre>
  
  <p>oddsmat.html
      </p>
  
  <pre><code>{% load staticfiles %}
  
  
  &lt;form action="" method="POST"&gt;
      {% csrf_token %}
      {{ form.as_p }}
  
      &lt;input type="submit" value="Submit" name="form1"/&gt;
  &lt;/form&gt;
  
  &lt;form action="" method="POST"&gt;
      {% csrf_token %}
      {{ form.as_p }}
  
      &lt;input type="submit" value="Submit" name="form2"/&gt;
  &lt;/form&gt;
  
  
  ... 
  
  
  {{ round1 }}
  {{ round2 }}
  {{ round3 }}
  {{ betround1 }}
  {{ betround2 }}
  {{ betround3 }}
  
  &lt;br&gt;
  its the same as {{ thesameas }}
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from django.shortcuts import render
  from django.views.generic import TemplateView
  from amat.forms import AmatForm
  
  # Create your views here.
  
  
  class AmatView(TemplateView):
      template_name = 'oddsmat.html'
  
      def get(self, request):
          form = AmatForm()
  
          args = {
              "form": form
          }
          return render(request, self.template_name, args)
  
      def post(self, request):
          form = AmatForm(request.POST)
          if  form.is_valid():
  
              round1 = form.cleaned_data['round1']
              round2 = form.cleaned_data['round2']            
              round3 = form.cleaned_data['round3']            
              form = AmatForm()
              betround1 = ((round2+1)*(round3+1))/((round1)*(round2+2)+(round2)*(round3+2)+(round3)*(round1+2)+3)
              betround2 = ((round1+1)*(round3+1))/((round1)*(round2+2)+(round2)*(round3+2)+(round3)*(round1+2)+3)
              betround3 = ((round2+1)*(round1+1))/((round1)*(round2+2)+(round2)*(round3+2)+(round3)*(round1+2)+3)
              thesameas = round1*betround1-betround2-betround3
  
              args = {
                  "form": form,
                  "round1":round1,
                  "round2":round2,
                  "round3":round3,
                  "betround1":betround1,
                  "betround2":betround2,
                  "betround3":betround3,
                  "thesameas":thesameas,
              }
          return render(request, self.template_name, args)
  
  class AmatView2(TemplateView):
      template_name = 'oddsmat.html'
  
      def get(self, request):
          form = AmatForm2()
  
          args = {
              "form": form
          }
          return render(request, self.template_name, args)
  
      def post(self, request):
          form = AmatForm2(request.POST)
          if  form.is_valid():
  
              round10 = form.cleaned_data['round10']
              round11= form.cleaned_data['round11']            
  
              form = AmatForm2()
  
  
  
              args = {
                  "form": form,
                  "round10":round10,
                  "round11":round11,
  
              }
          return render(request, self.template_name, args)
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>from __future__ import unicode_literals
  
  from django.db import models
  
  # Create your models here.
  class Post(models.Model):
  
      round1 = models.DecimalField(max_digits=12, decimal_places=5)
      round2 = models.DecimalField(max_digits=12, decimal_places=5)
      round3 = models.DecimalField(max_digits=12, decimal_places=5)
      created = models.DateTimeField(auto_now_add=True)
      updated = models.DateTimeField(auto_now=True)
  
  class Post2(models.Model):
      round10 = models.DecimalField(max_digits=12, decimal_places=5)
      round11 = models.DecimalField(max_digits=12, decimal_places=5)
      created = models.DateTimeField(auto_now_add=True)
      updated = models.DateTimeField(auto_now=True)
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code> from django import forms
   from amat.models import Post, 
  
   class AmatForm(forms.ModelForm):
      class Meta:
           model = Post
           fields = ('round1', 'round2', 'round3')
  
  class AmatForm2(forms.ModelForm):
      class Meta:
          model = Post2
          fields = ('round10', 'round11')
  </code></pre>