title: Get Data from Form on Button Click and Save to Db in Django
body: <p>I just started to learn Django, I have a page width a form to input data from users and save it to database. i have searched on Google but most of there use some sort of built-in modules or something like this.</p>
  
  <p>I have created a model</p>
  
  <pre><code>class Message(models.Model):
      MessageID = models.AutoField(verbose_name='Message ID',primary_key=True)
      MessageSubject = models.CharField(verbose_name='Subject',max_length=255)
      MessageContent = models.TextField(verbose_name='Content',)
  </code></pre>
  
  <p>and the view page.</p>
  
  <pre><code>{% extends "base.html" %}
  
  {% block Content %}
  
  &lt;div class="container"&gt;
    &lt;!-- Contacts --&gt;
    &lt;div id="contacts"&gt;
      &lt;div class="row"&gt;
        &lt;!-- Alignment --&gt;
        &lt;div class="col-sm-offset-3 col-sm-4"&gt;
          &lt;!-- Form itself --&gt;
          &lt;form name="sentMessage" class="well" id="contactForm"  novalidate&gt;
            &lt;legend&gt;Send Messages&lt;/legend&gt;
            &lt;div class="control-group"&gt;
              &lt;div class="controls"&gt;
                &lt;input type="text" class="form-control"
                placeholder="Subject" id="name" required
                data-validation-required-message="Please enter subject" /&gt;
                &lt;p class="help-block"&gt;&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;
  
  
            &lt;div class="control-group"&gt;
              &lt;div class="controls"&gt;
                &lt;textarea rows="10" cols="100" class="form-control"
                placeholder="Message" id="message" required
                data-validation-required-message="Please enter your message" minlength="5"
                data-validation-minlength-message="Min 5 characters"
                maxlength="999" style="resize:none"&gt;&lt;/textarea&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label&gt;
                &lt;input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked&gt;
                Send Sms to Selected Users
              &lt;/label&gt;
            &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label&gt;
                &lt;input type="radio" name="optionsRadios" id="optionsRadios2" value="option2"&gt;
                Send Email To Selected Users
              &lt;/label&gt;
            &lt;/div&gt;
            &lt;div id="success"&gt; &lt;/div&gt;
            &lt;button type="submit" class="btn btn-primary btn-sm pull-right"&gt;Send&lt;/button&gt;&lt;br /&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  
  
  {% endblock %}
  </code></pre>
  
  <p>I want when user input the data into form and click Send button the data will store in the database table. I am using sqlite database.</p>