title: How to send data from HTML form input type number to a variable in app views.py Django
body: <p>Here is input type number in template file</p>
  <pre class="lang-html prettyprint-override"><code>&lt;form action=&quot;&quot; method=&quot;get&quot;&gt;
      &lt;input class=&quot;form-control m-3 w-50 mx-auto&quot; type=&quot;text&quot; name=&quot;question&quot; id=&quot;question&quot; placeholder=&quot;Enter Something...&quot;&gt;
      &lt;input type=&quot;number&quot; id=&quot;typeNumber&quot; class=&quot;form-control m-3 w-50 mx-auto&quot; /&gt;
      &lt;input class=&quot;btn btn-primary btn-lg my-3&quot; type=&quot;submit&quot; value=&quot;Check Now&quot;&gt;
  &lt;/form&gt;
  </code></pre>
  <p>I want to get the number that is selected by the user.</p>
  <p>I need to store the number variable value to custom_number variable in views.py file. How can I do this?</p>
  <pre class="lang-py prettyprint-override"><code>def your_view(request):
      number = request.GET.get('number_input')
      number = int(number)
  
  custom_number = number
  
  def home_view(request):
      if request.method == &quot;GET&quot; and 'question' in request.GET:
          question = request.GET.get('question')
          data = custom_funct(question)
          context = {'data': data}
      else:
          context = {}
      return render(request, 'home.html', context) 
  </code></pre>
  <p>Thanks</p>