[Answered ]-AttributeError 'str' object has no attribute 'get' json from file

1👍

You can not return the result of a reverse in a view, since that is a str, and a view should return a HttpResponse:

if model.check_login(request):
    ad = User.objects.get(UID=login_user_uid(request))
    per = {"perto": False}
    status = per['perto']
    print(f'sdf {type(status)}')
    print(f'sdf {status}')
    if per['perto']:
        return render(request, 'users/add_user.html', {})
    else:
        return redirect('home')
else:
    return redirect('login')

Leave a comment