[Answer]-Using reverse url lookup in django template with keyword arguements

1👍

Your assumption is unfortunately completely wrong. Keyword arguments are passed in the URL, they are simply sent to the view function in a different way – in kwargs instead of args.

The simplest way to solve your problem is just to check the user in the download function itself.

def download(request, pk):
    obj = Download.objects.get(pk)
    if obj.customer_id != request.user.id:
        return HttpResponseForbidden()

Leave a comment