[Answer]-Django Function View Skips Loop?

1👍

✅

You don’t actually return the HttpResponse generated by the render statement inside the if block. Try changing:

if statusly == 'Paste':
    render(request, 'thunderdome/paste_form.html')

to:

if statusly == 'Paste':
    return render(request, 'thunderdome/paste_form.html')

As you can see in the documentation, the render method returns a HttpResponse object. You are discarding that response and falling through to the return HttpResponse(statusly) statement.

Leave a comment