[Answered ]-Django – i always get my profile when i what to view another users profile

1👍

I just fixed it now, in my profile.html, i am using {{request.user.profile.first_name}} to display the informations. I was supposed to use {{profile.first_name}} etc, and that was it.

0👍

Instead of this:

<a href="{% url 'profile' creator.user %}">

you should try:

<a href="{% url 'profile' creator.user.username %}">

From the presumably working statement get_object_or_404(User, username=username) I assume that username is a field (hopefully, unique) of the User. So you should pass it onto the URL, not the entire User model.

Leave a comment