title: My form is not getting submitted in django. What's wrong with my code?
body: <p>I am making a complaint management system but the page where I need to accept and save complaints from users, the form isn't even getting submitted as I can't even see the submitted message.</p>
  <p>models.py:</p>
  <pre><code>class Complaint(models.Model):
     user = models.ForeignKey(User, on_delete= models.CASCADE, null = True, blank=True)
     title = models.CharField(max_length=300)
     description = models.TextField(null=True, blank= True)
     highpriority = models.CharField(max_length=200, blank=True)
     document = models.FileField(upload_to='static/documents')
  
     def __str__(self):
         return self.title
  </code></pre>
  <p>forms.py:</p>
  <pre><code>    PRIORITY_CHOICES= [
      ('high', 'High'),
      ('low', 'Low'),
      ]
  
     class ComplaintForm(ModelForm):
         highpriority = forms.CharField(label='Priority', 
     widget=forms.RadioSelect(choices=PRIORITY_CHOICES))
         class Meta:
             model = Complaint
             fields = ['title', 'description', 'highpriority', 'document']
          
      def clean(self):
          cleaned_data = super(ComplaintForm, self).clean()
          title = cleaned_data.get('title')
          description = cleaned_data.get('description')
          if not title and not description:
              raise forms.ValidationError('You have to write something!')
  </code></pre>
  <p>views.py:</p>
  <pre><code>def NewComplaint(request):
  user = request.user
  if request.method == 'POST':
      form = ComplaintForm(request.POST)
      if form.is_valid():
          cmp_obj = form.save(commit=False)
          cmp_obj.user = user
          cmp_obj.save()
      submitbutton= request.POST.get('Submit')
  
      if submitbutton:
          messages.success(request, 'Submitted!')
      context = {'form': form}
      return render(request, 'new.html', context)
  else:
      form = ComplaintForm()
      context = {'form': form}
      return render(request,'new.html',context)
  </code></pre>
  <p>template:</p>
  <pre><code>&lt;!-- Middle Container --&gt;
      &lt;div class=&quot;col-lg middle middle-complaint-con&quot;&gt;
          &lt;i class=&quot;fas fa-folder-open fa-4x comp-folder-icon&quot;&gt;&lt;/i&gt;
          &lt;h1 class=&quot;all-comp&quot;&gt;New Complaint&lt;/h1&gt;
  
          &lt;form class=&quot;&quot; action=&quot;&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;
              {% csrf_token %}
              &lt;div class=&quot;form-control col-lg-10 comp-title-field&quot; name=&quot;title&quot;&gt;{{form.title}}&lt;/div&gt;
              &lt;p class=&quot;desc&quot;&gt;Description&lt;/p&gt;
              &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary preview-btn&quot;&gt;Preview&lt;/button&gt;
              &lt;div class=&quot;Descr &quot; name=&quot;description&quot;&gt;{{form.description}}&lt;/div&gt;
              {{message}}
              &lt;button type=&quot;file&quot; name=&quot;myfile&quot; class=&quot;btn btn-secondary attach-btn&quot;&gt;&lt;i class=&quot;fas fa-file-upload&quot;&gt;&lt;/i&gt; Attachment&lt;/button&gt;
              &lt;button type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;btn btn-secondary save-btn&quot; value=&quot;Submit&quot;&gt;&lt;i class=&quot;fas fa-save&quot;&gt;&lt;/i&gt; Save&lt;/button&gt;
          &lt;/form&gt;
  
      &lt;/div&gt;
  
      &lt;!-- Right Container --&gt;
      &lt;div class=&quot;col right-pro-con&quot;&gt;
          &lt;div class=&quot;img-cir&quot;&gt;
              &lt;form method='POST' action=&quot;&quot; enctype=&quot;multipart/form-data&quot;&gt;
                  {% csrf_token %} {% if request.user.profile.profile_pic.url %}
                  &lt;img src={{request.user.profile.profile_pic.url}} alt=&quot;&quot; width=&quot;100px&quot; height=&quot;100px&quot; class=&quot;pro-img&quot;&gt; {% else %}
                  &lt;img src=&quot;{% static 'profileimages/msi.jpg' %}&quot; alt=&quot;&quot; width=&quot;100px&quot; height=&quot;100px&quot; class=&quot;pro-img&quot;&gt; {% endif %}
                  &lt;p class=&quot;my-name&quot;&gt;{{request.user.profile.first}}
                      &lt;p&gt;
                          &lt;p class=&quot;my-email-id&quot;&gt;{{request.user.profile.email}}&lt;/p&gt;
              &lt;/form&gt;
          &lt;/div&gt;
          &lt;p class=&quot;prio-txt&quot;&gt;Priority&lt;/p&gt;
  
          &lt;div class=&quot;form-check&quot;&gt;
              &lt;input class=&quot;form-check-input new-radio-btn-1&quot; type=&quot;radio&quot; name=&quot;gridRadios&quot; value=&quot;option1&quot; checked&gt;
              &lt;label class=&quot;form-check-label radio-label-1&quot;&gt;
          High
        &lt;/label&gt;
          &lt;/div&gt;
          &lt;div class=&quot;form-check&quot;&gt;
              &lt;input class=&quot;form-check-input new-radio-btn-2&quot; type=&quot;radio&quot; name=&quot;gridRadios&quot; value=&quot;option2&quot;&gt;
              &lt;label class=&quot;form-check-label radio-label-2&quot;&gt;
          Low
        &lt;/label&gt;
          &lt;/div&gt;
  </code></pre>
  <p>This is how the page should look:</p>
  <p><a href="https://i.stack.imgur.com/YFh6C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YFh6C.png" alt="enter image description here" /></a></p>
  <p>And the complaints need to get saved here but I see nothing when I click save:</p>
  <p><a href="https://i.stack.imgur.com/Kwn3o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kwn3o.png" alt="enter image description here" /></a></p>
  <p>Can someone please tell me what's wrong with my code</p>