title: request.POST.get didn't get the input value
body: <p>So, what I was trying to do is that user input a base64 encoded image and than convert it to text via pytesseract OCR. The problem is every time I tried to input it only reload the page and nothing happens.</p>
  <p>Here's my html snippet :</p>
  <pre><code>&lt;form method=&quot;POST&quot; action=&quot;{% url 'ocr-view'%}&quot;&gt; {% csrf_token %}
          &lt;label for=&quot;base64&quot;&gt; Input Base64 :&lt;/label&gt;
          &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;text&quot; name=&quot;base64&quot; /&gt;
          &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary mt-3&quot; name=&quot;submit&quot;&gt;
          &lt;i class=&quot;fas fa-search&quot;&gt;&lt;/i&gt;
             Submit
          &lt;/button&gt;
  &lt;/form&gt;
  
  
  &lt;div class=&quot;card-body&quot;&gt;
       &lt;label&gt; Result : &lt;/label&gt; &lt;br&gt;
       &lt;span class=&quot;h3&quot;&gt;{{text}}&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Here's my views.py :</p>
  <pre><code>class IndexView(LoginRequiredMixin, CreateView):
      model = Ocr
      template_name = &quot;ocr/ocr.html&quot;
      fields = ['input']
  
  
      def get_context_data (self):
          text = &quot;&quot;
          
          if self.request.method == 'POST':
              imgstring = self.request.POST.get('base64')
              imgstring = imgstring.split('base64,')[-1].strip()
              image_string = BytesIO(base64.b64decode(imgstring))
              image = Image.open(image_string)
  
              text = pytesseract.image_to_string(image)
              text = text.encode(&quot;ascii&quot;, &quot;ignore&quot;)
              text = text.decode()
  
          context = {
              'text': text,
          }
          return context
  </code></pre>
  <p>Urls.py :</p>
  <pre><code>from django.urls import path
  from .views import IndexView
  
  urlpatterns = [
    path(&quot;&quot;, IndexView.as_view(), name=&quot;ocr-view&quot;),
    path('&lt;int:pk&gt;/', IndexView.as_view(), name='ocr-input'),
  ]
  </code></pre>
  <p>But if i put the base64 code directly to views.py the OCR function work perfectly.</p>
  <pre><code>imgstring = 'data:image/jpeg;base64,/9j/somerandomcode'
  imgstring = imgstring.split('base64,')[-1].strip()
  image_string = BytesIO(base64.b64decode(imgstring))
  image = Image.open(image_string)
  
  text = pytesseract.image_to_string(image)
  text = text.encode(&quot;ascii&quot;, &quot;ignore&quot;)
  text = text.decode()
  
  context = {
      'text': text,
  }
  return context
  </code></pre>
  <p>I assume there is something wrong with my post method, please review my code is there anything wrong</p>