title: django - check if form data exists in request
body: <p>This is a crazy question, I know, but I just want to make sure. </p>
  
  <p>There is this code in <code>Django</code>: </p>
  
  <pre><code>if request.method == 'POST':
       do_something()
  </code></pre>
  
  <p>It checks if the form was really submitted in POST method. My question is: does it also check if there is a form data in request at all? I mean, I could take the <code>preview</code> page's url and just visit this link without filling form fields. Does this check above detect this case? </p>
  
  <p>If it does not check for form data existence, how can I achieve this? Btw, I am not using <code>Django</code> <code>forms</code>. I am just receiving data in view like this: </p>
  
  <pre><code>data['year'] = request.POST.get('year')
  </code></pre>
  
  <p>and all validation is happening in frontend with <code>Javascript</code>.</p>