[Answered ]-Using GET variables with django

2πŸ‘

βœ…

If engage is a view, it needs to return a response. Preferably an HTTP response that the user’s browser can render.

You can try something like this:

def engage(request):
  n = int(request.GET.get('n', 0))
  return HttpResponse('<html><body>You sent over %s</body></html>' % n)

Also your URL should look like:

domain.com/engage/?n=10
πŸ‘€2ps

Leave a comment