[Solved]-DJANGO: How to sort objects based on attribute of a related model? 3 March 2024 by thecoderscamp.com 16👍 ✅ User.objects.order_by('last_name', 'userprofile__title') 👤San4ez How to access cookies in Django TestCase request and responses? Source:stackexchange.com