title: Submit button not working and redirecting to 404 error page in Django
body: <p>I have deployed Django in my site subdomain apps.<a href="https://webmatrices.com" rel="nofollow noreferrer">webmatrices.com</a> through cPanel and the home page of my Django app <a href="https://apps.webmatrices.com/adsense-eligibility-checker" rel="nofollow noreferrer">apps.webmatrices.com/adsense-eligibility-checker</a> is working but when I fill the form and click on the <strong><em>SUBMIT</em></strong>  Button it redirects to 404 error page instead of running the second function <strong><em>scanned(requests)</em></strong> in mainApp/views.py. But it works in local host.</p>
  
  <p>This is inside mainApp/views.py directory:</p>
  
  <pre><code>    def home(request):
          return render(request, 'home.html')
  
  
      def scanned(request):
          email = request.POST['email']
          site = request.POST['site']
          rating = request.POST['stars']
          source = request.POST.getlist('source')
  ......
          return render(request, "result.html", {'rMsg':rMsg,'result0':result0, 'result1':result1,'site': site,'show_site':show_site, 'vips':m1, 'domain':domain, 'site_age':site_age, 'sent': sent})
  </code></pre>
  
  <p>Inside MainApp/urls.py:</p>
  
  <pre><code>from django.urls import path
  from.import views
  
  urlpatterns=[
  
      path('', views.home, name='home'),
      path('scanned/', views.scanned, name='scanned')
  
  ]
  </code></pre>
  
  <p>Inside home.html:</p>
  
  <pre><code>{% extends 'main.html' %}
  {% load static %}
  {% block content %}
  {% csrf_token %}
  &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"&gt;
  
  &lt;link rel="stylesheet" href="{% static 'style.css' %}"&gt;
  
    &lt;form method='POST' action="/scanned/" class='FormBody'&gt;
      {% csrf_token %}
      &lt;div id='tab'&gt;
        &lt;h2&gt;Adsense Eligibility Checker&lt;/h2&gt;
        &lt;fieldset class='siteAndEmail'&gt;
          &lt;legend&gt;Site &amp; Email&lt;/legend&gt;
          &lt;div class='form-wrapper'&gt;
            &lt;div class='full-input'&gt;
              &lt;label for="site"&gt;Your Site URL&lt;/label&gt;
              &lt;input type="domain" name='site' class='input' placeholder="https://yoursite.com"&gt;
            &lt;/div&gt;
  
            &lt;div class='full-input'&gt;
              &lt;label for="email"&gt;Your Email&lt;/label&gt;
              &lt;input type="text" name='email' class='input' placeholder="youremail@gmail.com"&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/fieldset&gt;
        &lt;fieldset class='siteAndEmail reached'&gt;
          &lt;legend&gt;How did you reached us?&lt;/legend&gt;
          &lt;label class='c1'&gt;
            &lt;input type="checkbox" name='source' value='Facebook' /&gt;
            &lt;i id='icon' class="fa fa-facebook"
              style='background:linear-gradient(white,lightblue); color:dodgerblue;'&gt;&lt;/i&gt;
            Via Facebook
          &lt;/label&gt;
          &lt;label class='c1'&gt;
            &lt;input type="checkbox" name='source' value='Google Search' /&gt;
            &lt;i id='icon' class="fa fa-google"
              style='background:linear-gradient(160deg,yellow, dodgerblue,rgb(255, 0, 119), rgb(157, 255, 0)); color:white;'&gt;&lt;/i&gt;
            Via Google Search
          &lt;/label&gt;
          &lt;label class='c1'&gt;
            &lt;input type="checkbox" name='source' value='Quora' /&gt;
            &lt;i id='icon' class="fa fa-quora"
              style='background:linear-gradient(rgb(236, 0, 0),rgb(158, 0, 0)); color:white;'&gt;&lt;/i&gt;
            Via Quora
          &lt;/label&gt;
          &lt;div style='display:inline-block;'&gt;
            OTHERS
            &lt;input type="text" name='source'
              style="background:rgba(255, 255, 255, 0.048);font-family:'Courier New', Courier, monospace; border:0px; border-bottom:1px solid rgba(0, 0, 0, 0.568);line-height:1.5em; padding-left:3px;"
              placeholder="others" /&gt;
  
          &lt;/div&gt;
        &lt;/fieldset&gt;
      &lt;/div&gt;
      &lt;fieldset class='siteAndEmail'&gt;
        &lt;legend&gt;Rate Our Service&lt;/legend&gt;
        &lt;div class='rating'&gt;
          &lt;label&gt;
            &lt;input type="radio" name="stars" value="1" /&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
          &lt;/label&gt;
          &lt;label&gt;
            &lt;input type="radio" name="stars" value="2" /&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
          &lt;/label&gt;
          &lt;label&gt;
            &lt;input type="radio" name="stars" value="3" checked /&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
          &lt;/label&gt;
          &lt;label&gt;
            &lt;input type="radio" name="stars" value="4" /&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
          &lt;/label&gt;
          &lt;label&gt;
            &lt;input type="radio" name="stars" value="5" /&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
            &lt;span class="icon"&gt;★&lt;/span&gt;
          &lt;/label&gt;
        &lt;/div&gt;
      &lt;/fieldset&gt;&lt;br&gt;
      &lt;button class='butn'&gt; S C A N &lt;/button&gt;
  
  
  &lt;/form&gt;
  {% endblock %}
  </code></pre>
  
  <p>Inside result.html:</p>
  
  <pre><code>{% extends 'main.html' %}
  {% load static %}
  {% block content %}
  {% load static %}
  {% csrf_token %}
  &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"&gt;
  &lt;link rel="stylesheet" href="{% static 'style2.css' %}"&gt;
  &lt;div class='borders'&gt;
  &lt;h2&gt;R E S U L T Of Scanning Via Adsense Eligibility Checker&lt;/h2&gt;
  &lt;div id='result'&gt;
  &lt;ul style='text-align:left;'&gt;
      &lt;li type='disc'&gt;
          {{result1}}
          &lt;script&gt;
          if ('{{rMsg}}'== ''){
              document.write('&lt;br&gt;');
              console.log('rMsg Level 1');
          }
          else {
              document.getElementById('rmsg').innerHTML=('{{rMsg}}');
              console.log('rMsg Level 2');
          }
  
      &lt;/script&gt;
      {{result0}}
      &lt;a id='rmsg'&gt;&lt;/a&gt;&lt;br&gt;&lt;a alt='What are the pages required for Adsense Approval' title='Pages Required For Adsense Approval' style='display:inline-block; text-decoration:none; color:rgb(196, 255, 87);' href='https://blog.webmatrices.com/check-website-eligibility-for-google-adsense/#What_are_the_pages_required_for_Adsense_approval'&gt;
   Pages Required For Adsense Approval
      &lt;/a&gt;
  &lt;/li&gt;
      &lt;li type='disc'&gt;{{domain}}&lt;/li&gt;
      &lt;li type='disc'&gt;{{site_age}}&lt;/li&gt;
      &lt;p style='text-align:center;'&gt;&lt;i id='icon' class="fa fa-globe" style='background:linear-gradient(rgba(0, 250, 146, 0.596),rgba(0, 140, 255, 0.637)); color:rgb(255, 255, 255);'&gt;&lt;/i&gt;
          &lt;a href='{{site}}' style='display:inline-block; text-decoration:none; color:rgb(0, 255, 179);'&gt;{{show_site}}&lt;/a&gt; is awesome.
  
      &lt;/p&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;p style='font-size:medium;font-family:serif;'&gt;{{sent}}&lt;/p&gt;
  &lt;br&gt;
  &lt;a style='font-family:Consolas;font-size:larger;font-weight:bolder;display:inline-block; text-decoration:none; color:rgb(196, 255, 87);' href='https://blog.webmatrices.com/check-website-eligibility-for-google-adsense/#What_are_the_minimum_requirements_for_Adsense_Approval' title='Minimum requirements for Adsense Approval'&gt;Min-Requirements for Adsense Approval&lt;/a&gt;
  
  {% endblock %}
  </code></pre>