1👍
✅
probably you are need force_str
more here: https://docs.djangoproject.com/en/4.1/ref/utils/#django.utils.encoding.force_str
in your case:
user = User.objects.get(pk=uid.decode("utf-8"))
more here:
https://docs.python.org/3/library/stdtypes.html#bytes.decode
Source:stackexchange.com