title: Method Not Allowed (POST): /contact/sent/
body: <p>I am getting this method not allowed(post), like I can't post my forms.what could I be doing wrong.I am new to django. Could my url.py be wrong or my form-id is incorrect that doesn't enable the posting of data.I have the forms.py here, not sure if that could be a problem to my problem</p>
  
  <p>views.py</p>
  
  <pre><code>class ContactUsView(ContactFormView):
      """ Contact Us Form View """
      form_class = ContactUsForm
  
      def get_success_url(self):
          return reverse('messaging:contact_form_sent')
  
  
  def clear_notification(request):
      """ Clears the notification for a given user"""
  
      Notifications.objects.filter(user=request.user).delete()
      return redirect(reverse('accounts:dashboard', args=(request.user,)))
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>urlpatterns = [
      path(
          'contact/',
          views.ContactUsView.as_view(),
          name='contact_form'),
      path(
          r'contact/sent/',
          TemplateView.as_view(
              template_name='contact_form/contact_form_sent.html'),
          name='contact_form_sent'),
      path(r'clear/', views.clear_notification, name='clear_notification'),
  ]
  </code></pre>
  
  <p>contact_form.html</p>
  
  <pre><code>           &lt;div class="row"&gt;
             &lt;form id='ContactUsForm' method='post' action={% url 'messaging:contact_form_sent' %}&gt;&lt;br&gt;
              {% csrf_token %}
                 &lt;div class="col-md-6"&gt;
                     &lt;div class="form-group"&gt;
                     {% csrf_token %}
                         &lt;input type="text" class="form-control input-upper" id="fullname" placeholder="John Doe" name="fullname"&gt;
                     &lt;/div&gt;
                 &lt;/div&gt;
                 &lt;div class="col-md-6"&gt;
                     &lt;div class="form-group"&gt;
                     {% csrf_token %}
                         &lt;input type="email" class="form-control input-upper" id="email" placeholder="Email" name="email"&gt;
                     &lt;/div&gt;
                 &lt;/div&gt;
             &lt;/div&gt;&lt;br&gt;&lt;br&gt;
             &lt;div class="row"&gt;
                 &lt;div class="col-md-6"&gt;
                     &lt;div class="form-group"&gt;
                     {% csrf_token %}
                         &lt;input type="text" class="form-control input-upper" id="subject" placeholder="Subject" name="subject"&gt;
                     &lt;/div&gt;
                 &lt;/div&gt;
              &lt;/div&gt;&lt;br&gt;
              &lt;div class="row"&gt;
                 &lt;div class="col-md-10"&gt;
                     &lt;div class="form-group"&gt;
                     {% csrf_token %}
                         &lt;textarea class="form-control input-upper" id="message" placeholder="Message" name="message"&gt;&lt;/textarea&gt;
                     &lt;/div&gt;
                     {% csrf_token %}
                     &lt;button type="submit" class="btn btn-primary btn-send-contact" value="SUBMIT"&gt;SEND&lt;/button&gt;
                 &lt;/div&gt;
              &lt;/div&gt;&lt;br&gt;&lt;br&gt;
              &lt;/form&gt;
         &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>base-view</p>
  
  <pre><code>"""
  
  """
  
  from django.views.generic.edit import FormView
  
  from .forms import ContactForm
  
  try:
      from django.urls import reverse
  except ImportError:  # pragma: no cover
      from django.core.urlresolvers import reverse  # pragma: no cover
  
  
  class ContactFormView(FormView):
      form_class = ContactForm
      recipient_list = None
      template_name = 'contact_form/contact_form.html'
  
      def form_valid(self, form):
          form.save()
          return super(ContactFormView, self).form_valid(form)
  
      def get_form_kwargs(self):
          # ContactForm instances require instantiation with an
          # HttpRequest.
          kwargs = super(ContactFormView, self).get_form_kwargs()
          kwargs.update({'request': self.request})
  
          # We may also have been given a recipient list when
          # instantiated.
          if self.recipient_list is not None:
              kwargs.update({'recipient_list': self.recipient_list})
          return kwargs
  
      def get_success_url(self):
  
          return reverse('contact_form_sent')
  </code></pre>