title: Save data from Django Python form to database
body: <p>Okay so I have read two previous posts on this subject here but did not help me out all too much, went over to Django tutorial, also did not find a solution. 
  I have a bad feeling I am doing something really stupid here.</p>
  
  <p>I have a form where I input data on the site and no matter what I do I cannot get them to save to a database</p>
  
  <p>Setup:
  OS:Fedora 
  IDE: eclipse
  Django 1.9  Python 2.7
  Default Django DB</p>
  
  <p>CODE:</p>
  
  <p>new.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
  
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;h1&gt;Create a New One&lt;/h1&gt;
              &lt;form method='post' action="/home/"&gt; {% csrf_token %}
                  &lt;table&gt;
                      {{ formset.as_p }}
                  &lt;/table&gt;
              &lt;/form&gt;
  
                  &lt;input type='submit' value="Submit"&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Viwes.py</p>
  
  <pre><code>def home(request):
      form = NewForm(request.POST or None)
      if form.is_valid():
          instance = form.save(commit=False)
          instance.save()
      context = {
          "formset" : form
      }
      return render(request, "secondTry/new.html", context)
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>from django.forms import ModelForm
  from secondTry.models import New
  
  
  class NewForm(ModelForm):
      class Meta:
          model = New
          fields = [
                    "firstName", 
                    "lastName", 
                    "email"
                    ]
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class New(models.Model):
      firstName = models.CharField(max_length=50, null=True)
      lastName = models.CharField(max_length=50, null=True)
      email = models.EmailField()
      timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
      updated = models.DateTimeField(auto_now_add=False, auto_now=True)
  
      def __unicode__(self):
          return smart_unicode(self.firstName)
  </code></pre>
  
  <p>Everything displays as it should on the site when I open it and I can write data into forms but when I click the Submit button, it does not save it to the database.</p>
  
  <p>I have tried my best to explain my problem, if you require further info please ask.</p>
  
  <p>Thank you all for your time and effort. </p>