title: Different ways for sending request context with HttpResponseRedirect in django
body: <p>I have a django app and implemented payment gateway functionality. 
  Now what i was trying is </p>
  
  <p>After successful transation, need to do redirect user to another page that shows the response details so i am using <code>HttpresponseRedirect</code> to redirect the page, but i have the variable <code>response</code> in the view that contains reponse details, so i need to send this variable as the context to the redirecting url that renders template, so that i can use that response variable to display the results. </p>
  
  <p>so for the above functionality, i got three methods</p>
  
  <ol>
  <li>Sending the variable as the query parameter(which is not safe in this method because it is sensitive credit card transaction details)</li>
  <li>Using session framework, which is not working in my case, the code is below</li>
  <li>Django messaging framework(which is not so useful in this case)</li>
  </ol>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>def payment(request):
      amount = 1
      if request.method == 'POST':
          form = CreditCardForm(request.POST)
          if form.is_valid():
              data = form.cleaned_data
              ...........
              ........... 
              response = stripe.payment_purchase(amount,data) 
              request.session['response'] = response
              return HttpResponseRedirect(reverse('paygate:payment_success'))
      else:
          form = CreditCardForm(initial={'number':'4242424242424242'})
      return render_to_response('payment/stripe_payment_form.html',{'form': form,
                                               'response':response,},
                                               context_instance=RequestContext(request))
  </code></pre>
  
  <p><strong>payment_success url view</strong></p>
  
  <pre><code>class PaymentSuccess(TemplateView):
      template_name = 'payment/payment_success.html'
  </code></pre>
  
  <p>I tried to access <code>response</code> variable in the template, but displaying nothing</p>
  
  <p><strong>payment_success.html</strong></p>
  
  <pre><code>{% extends "base.html" %}
  {% block main_title %}Payment{% endblock %}
  {% block title %}Success{% endblock %}
  
  {% block content %}
    &lt;h1&gt;Response Details&lt;/h1&gt;
    &lt;p&gt;Your status is &lt;span&gt;{{ request.session.response }}&lt;/span&gt;&lt;/p&gt;
  {% endblock %} 
  </code></pre>
  
  <p>So can anyone please let me know the various different safe and secure ways to send context variables(in this case <code>credit card payment details</code>) to redirecting url using <code>HttpResponseRedirect</code> method</p>