[Answered ]-How to get user profile based on username?

1👍

Your slug field should be like this.

class ProfileDetail(DetailView):
    model = Profile
    template_name = 'profile.html'
    slug_field = "user__username"

And you don't need to override the get_object method also.

👤arjun

Leave a comment