title: How to access user input (POST) in different Django views
body: <p>I have a view called "search" which stores POST input as "search_id" but "search_id" is only available in the scope of the view "search". I want to be able to access the variable "search_id" in my view "dispTable". </p>
  
  <p>Disclaimer- if this part of my question makes no sense, plz ignore: I understand that I could add an additional parameter to dispTable which would allow me to pass the search_id into dispTable in a return statement but what if I wanted to be able to access search_id in multiple views.</p>
  
  <pre><code>def search(request):
      if request.method == 'POST' :
          search_id = request.POST.get('textfield', None)            
          try:
              return dispTable(request)                
          except Person.DoesNotExist:
              return HttpResponse("no such user")                
          except Person.MultipleObjectsReturned :
              #return dispTable(request, search_id)
              return showResults(request)                
      else :
           return render(request, 'People/search.html')
  
  def dispTable(request) :
      table = authTable(Person.objects.filter(MAIN_AUTHOR = 'search_id'))
      RequestConfig(request).configure(table)
      #return render(request, 'People/tableTemp.html', {'table':table}) 
      return render(request, 'People/tableTemp.html', {"table" : Person.objects.filter(MAIN_AUTHOR = search_id)})  
  </code></pre>
  
  <p>I also tried using a form, but I still did not know how to access the input variable in additional views, like dispTable</p>
  
  <pre><code>from django import forms
  
  class SearchForm(forms.Form) :
      search_id = forms.CharField(max_length=100)
      def process(self) :
          search_id = self.cleaned_data['search_id']
  
  def search(request) :
      if request.method == 'POST' :
          form = SearchForm(request.POST)
          if form.is_valid() :
              form.process()                
          return dispTable(request)
      else :
          form = SearchForm()
      return render (request, 'People/search.html')
  </code></pre>
  
  <p>And here is my html file: </p>
  
  <pre><code>&lt;form method="POST" action="send/"&gt;
      {% csrf_token %}
      &lt;input type="text" name="textfield"&gt;
      &lt;button type="submit"&gt;Upload text&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>