Created
January 17, 2019 15:29
-
-
Save olivx/5a6793eb35e7ccf1a69019e720adba9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode, force_bytes, force_text | |
urlsafe_base64_encode(force_bytes(user.pk)) | |
user_id = urlsafe_base64_decode(force_text(uidb64)) | |
user = get_object_or_404(get_user_model(), pk=user_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment