title: How to render the data to another template after submitting the Django-Form?
body: <p>I want to do the following things:
  <li> User will open a page i.e. <code>network_form.html</code> and fill the form which contain two fields (see the form.py)</li>
  <li> After submitting that form. Server will perform calculation on the bases of these two fields and render the calculated data to another page i.e. <code>subnet_network.html</code></li></p>
  
  <p>Take a look on from.py:</p>
  
  <pre><code> class SubnetCreateFrom(forms.Form):
       Subnet_Address = forms.CharField(max_length=40)
       IP_Address = forms.CharField(max_length=40)
  </code></pre>
  
  <p>Now i want to submit these form fields and want to process some query on the bases of these field. So, i write the following vies.py:</p>
  
  <pre><code> def subnet_network(request):
     if request.method == 'POST':
        form = SubnetCreateFrom(request.POST)
        if form.is_valid():
           subnet = form.data['Subnet_Address']
           ip = form.data['IP_Address']
           # Here i am manipulating the data using the above subnet and ip fields and pass the data in the form of parameter to the follwing method. i.e. get_host_list
           subnet_network_detail(request,get_hosts_list) #[1]
           return HttpResponseRedirect('../../list/')
   extra_context = {
       'form': SubnetCreateFrom(initial={'user': request.user.pk})
   }
   return direct_to_template(request, 'networks/network_form.html',
                            extra_context)
  </code></pre>
  
  <p>Template network_form.html:</p>
  
  <pre><code>  &lt;form action="" method="POST"&gt;
          {{ form.as_p }}
      &lt;input type="submit" value="{% trans "Show Host" %}"/&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>when the form has been filled by a user after clicking on the submit button. Ot should open a new page showing the processing data i.e. <code>get_host_list</code>. That is why i called a subnet_network_detail method from the mid of the above defined subnet_network method So that we can render that data to the next template. is this right way to do it ? </p>
  
  <p>Definition of  subnet_network_detail are following: (which also in the same views.py)</p>
  
  <pre><code> def subnet_network_detail(request,list_hosts):
      extra_context = {
         'subnet_hosts': list_hosts
         }#[2]
      return direct_to_template(request, 'networks/subnet_network.html',
                             extra_context)
  </code></pre>
  
  <p>Url pattern for above methods are following:</p>
  
  <pre><code>url(r'^myapp/netmask/create/$',
      'subnet_network', name='subnet_network'),
  url(r'^myapp/netmask/select/$',
      'subnet_network_detail', name='subnet_network_detail')
  </code></pre>
  
  <p>Is there something wrong with URL pattern. 
  Why i am not able to rendering the data accessing from <code>SubnetCreateForm</code> to another template i.e. <code>subnet_network.html</code>. Is this the right way to call that method or render the data to a template?</p>
  
  <p>Following things are happening when i check with the pdb putting it different different places:</p>
  
  <pre><code>[1] I used the python debugger at this position and it shows an error i.e. subnet_network_detail receiving one parameter and you are passing it two
  
  [2] After removing the pdb syntax from [1] and putting at this position i check whether the data is passing to this function or not and it was. I am getting the data what i want in list_hosts variable 
  
  
  
  And also after removing the pdb syntax from [2] position it redirect to the page what we have written in HttpResponseRedirect in the first method
  </code></pre>