title: How to store Global variable in Django view
body: <p>In <strong>Django views</strong>, is it possible to create a <strong>global / session variable</strong> and assign some value (say, sent through an Ajax call) in a view and make use of it in <strong>another view</strong>?</p>
  
  <p>The scenario I am trying to implement will be something like:</p>
  
  <p>View <strong>view1</strong> gets some variable data sent thru' Ajax call:</p>
  
  <pre><code>def view1(request):
      my_global_value = request.GET.get("data1", '')    # Storing data globally
  </code></pre>
  
  <p>Then, the stored variable is used in another view, <strong>view2</strong>:</p>
  
  <pre><code>def view2(request):
      my_int_value = my_global_value    # Using the global variable
  </code></pre>