title: reload page automatically without needing to RE-enter URL again Django
body: <p>My webpage consists of 2 parts, <em>upper part</em> is a section that let user to enter data while <em>bottom part</em> displays all the data in database in a table form. When user selects "Add" button in the upper part, the data will be saved into database and being outputted in a table in bottom part of the webpage. Is there anyway to show the table once i select the "Add" button ? Right now what the code is doing is when "Add" button is being selected, it will load a new form but then the whole table will disappear. I have to <strong>manually</strong> type this address again "<a href="http://127.0.0.1:8000/hrfinance/lscholarship/" rel="nofollow noreferrer">http://127.0.0.1:8000/hrfinance/lscholarship/</a>" then only the table will appear. Even with refreshing the page will not work. Below is my code in </p>
  
  <p><strong>views.py:</strong></p>
  
  <pre><code>def scholarship(request, id=None):
      query_results = []
      if request.method == "POST":
          form = ScholarshipForm(request.POST)
          if form.is_valid():
              scholarship = form.save(commit=False)
              scholarship.save()
      else:
          form = ScholarshipForm()
          id = request.GET.get('scholarship')
      query_results = Scholarship.objects.all()
      data = {
              'query_results':query_results,
              'form': form
             }
      return render(request, 'hrfinance/add_remove_scholarship.html', data)
  </code></pre>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Application(models.Model):
      studentID = models.CharField("Student ID", max_length=8, validators=[MinLengthValidator(8)], primary_key=True, default="")
      studentName = models.CharField("Student Name", max_length=500, default="")
      scholarship = models.TextField("Scholarship")
  </code></pre>
  
  <p><strong>add_remove_scholarship.html</strong></p>
  
  <pre><code>&lt;div align="center" &gt;
  &lt;form method="POST" onsubmit="return validation()" action=""&gt;
  {% csrf_token %}
  {{ form.errors }}
      &lt;p&gt;Upload File: {{ form.doc }}&lt;/p&gt;
      &lt;p&gt;Faculty: {{ form.faculty }} &lt;/p&gt;
      &lt;p&gt;Opening date: &lt;input id="odate" type="date" name="openDate"&gt; &lt;/p&gt;
      &lt;p&gt;Closing date: {{ form.closeDate }} &lt;/p&gt;
      &lt;input type="submit" name="AddScholarship" value="Add Scholarship"   &gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;br&gt;&lt;/br&gt;
      &lt;button id="button" type="button"&gt;Delete Selected Scholarship&lt;/button&gt;
      &lt;br&gt;&lt;/br&gt;
      {{query_results}}
      &lt;form method="POST" action=""&gt;
      {% csrf_token %}
  &lt;table  id="example" class="display" cellspacing="0" width="100%" border="1.5px"&gt;
      &lt;tr align="center"&gt;
          &lt;th&gt; Scholarship &lt;/th&gt;
          &lt;th&gt; Faculty &lt;/th&gt;
          &lt;th&gt; Open Date &lt;/th&gt;
          &lt;th&gt; Close Date &lt;/th&gt;
      &lt;/tr&gt;
      {% for item in query_results %}
      &lt;tr align="center"&gt;
          &lt;td&gt;{{item.doc}}&lt;/td&gt;
          &lt;td&gt;{{item.faculty}}&lt;/td&gt;
          &lt;td&gt;{{item.openDate}}&lt;/td&gt;
          &lt;td&gt;{{item.closeDate}}&lt;/td&gt;
      &lt;/tr&gt;
      {% endfor %}
      &lt;/table&gt;
      &lt;/form&gt;
  </code></pre>