Here is how to get user with related profile: Django: Difference between User.objects.profile.all() and User.objects.get_profile()?
But this example is using user id. I want to get user by activation_key which is in UserProfile object, I try something like:
UserProfile.objects.select_related('user').get(activation_key=key)
but I am getting:
UserProfile matching query does not exist.
1 Answer