title: What does 'request.GET.get' in an API creation do in Django and how does it work precisely?
body: <p>I'm watching a lecture about Django. The lecturer explains everything wonderfully but didn't go into much detail into &quot;an API I effectively created&quot;. This is my first time meddling with this so I'm a bit unsure.</p>
  <p>What I don't understand is specifically this line <code>request.GET.get(&quot;start&quot;)</code>. How does one make that work in the index.html file (with embedded js script) by just using a fetch?</p>
  <p>views.py</p>
  <pre><code>def posts(request):
      # Get start and end points
      start = int(request.GET.get(&quot;start&quot;) or 0)
      end = int(request.GET.get(&quot;end&quot;) or (start + 9))
      
      # Generate list of posts
      data = []
      for i in range(start, end + 1):
          data.append(f&quot;Post #{i}&quot;)
      
      # Artificially delay speed of response
      time.sleep(1)
  
      # Return list of posts
      return JsonResponse({
          &quot;posts&quot;: data
      })
  </code></pre>
  <p>index.html</p>
  <pre><code>    fetch(`/posts?start=${start}&amp;end=${end}`)
      .then(response =&gt; response.json())
      .then(data =&gt; {
         data.posts.forEach(add_post);
      })
  </code></pre>