title: Django: Form Won't Add to Database
body: <p>I can add to the database from the admin page but the form in template won't save. When I try to submit the form it just refreshes the form.</p>
  <p>views:</p>
  <pre><code>def newPost(request):
  
      if request.method == 'POST':
          form = NewPost(request.POST)
          if form.is_valid():
              form.save()
              return redirect('myposts')
      else:
          form = NewPost()
  
      return render(request, 'create/new_post.html', {'title_page': 'New Post', 'form': form})
  </code></pre>
  <p>Template:</p>
  <pre><code>&lt;form method=&quot;POST&quot; class=&quot;input_group&quot; action=&quot;&quot; enctype=&quot;multipart/form-data&quot;&gt;
      {% csrf_token %}
  
      {{ form }}
  
      &lt;div class=&quot;submit_container&quot;&gt;
              &lt;input class=&quot;submit_btn&quot; type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
      &lt;/div&gt;
  &lt;/form&gt;
      
  </code></pre>
  <p>Form:</p>
  <pre><code>class NewPost(forms.ModelForm):
      title = forms.CharField(widget=forms.TextInput(attrs={'class': 'form_input_text'}))
      product = forms.ChoiceField(widget=forms.Select(attrs={'class': 'form_input_select'}), choices=PRODUCT_CHOICES)
      caption_description = forms.CharField(max_length=1000, widget=forms.Textarea(attrs={'class': 'form_input_text', 'style':'resize:none;', 'rows': '3'}))
      full_description = forms.CharField(max_length=2000, widget=forms.Textarea(attrs={'class': 'form_input_text', 'style':'resize:none;'}), required=False)
      links = forms.CharField(max_length=2000, widget=forms.Textarea(attrs={'class': 'form_input_text', 'style':'resize:none;'}), required=False)
      release_date = forms.DateField(widget=forms.SelectDateWidget(attrs={'class': 'form_input_select_date'}, years=YEARS, empty_label=&quot;---&quot;), required=False)
      display_image = forms.ImageField(widget=forms.ClearableFileInput(attrs={'class': 'form_img_btn'}))
      
  </code></pre>