AttributeError 'tuple' object has no attribute 'get'

You are returning a tuple here:

elif retailer_pk:
    return (request, 'page-retailer-single.html', {
        "products": products,
        "sorting": filt["sorting"],
        "filtering": filt["filtering"],
        "retailer": retailer,
    })

Did you forget to add render there perhaps:

elif retailer_pk:
    return render(request, 'page-retailer-single.html', {
        "products": products,
        "sorting": filt["sorting"],
        "filtering": filt["filtering"],
        "retailer": retailer,
    })

Always make sure you have render after 'return', in your views functions

In my case I had not added the return render(request, app_name/index.html It took me a lot of time to find this bug and not even one of the answers on stack overflow mentioned it, that's why I posted it here.

{IMAGE} check the index and register functions and the error indicated below them.

Tags:

Python

Django