title: Storing user info from HTML forms to postgresql
body: <p>I want to store the user input from the html form, for example first and last name. And store these in my postgresql database.
  I created the html file:</p>
  
  <pre><code>    &lt;form  &gt;
        First Name: &lt;input type="text" name="fname"&gt;
        Last Name: &lt;input type="text" name="lname"&gt;
        &lt;input type="submit" name=""&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>I have created the model:</p>
  
  <pre><code>class User(models.Model):
      first_name = models.CharField(max_length=30)
      last_name = models.CharField(max_length=30)
  </code></pre>
  
  <p>I have also connected the postgre database in the settings.py file. I am bit confused about how to connect the frontend and database. I think I need to add the model to the views.py and get the POST request to get the user input and store in the models. Please nudge me in the right direction. Thanks</p>