На панели навигации возникает ошибка ValueError

моя панель навигации:

<form method = "POST">{% csrf_token %}           
<button class="navbar-brand", name = "next",value="next", href="/app/{{ app.id }}/start/begin">Next</a>
        </form>

мой деф:

def view2(request, app_id):

    index=0
    pdict = {1:2}
    adict = {1: 'start'}
    
    if request.method == 'GET':
        app = Application.objects.get(id=app_id)
        ac_id = list(adict.keys())[index]
        p_id = pdict[anode_id]
        return show(request=request,app_id=app_id,p_id=p_id)

    else:
        if request.POST.get("next"):
            index += 1
            ac_id = list(adict.keys())[index]
            page_id = pdict[anode_id]
            request.method ='GET'
            return show(request=request,app_id=app_id,p_id=p_id)

если я нажимаю next, то выдает ValueError:didn't return an HttpResponse object. Вместо него возвращается None. Как я могу решить эту проблему?

Вернуться на верх