I have a url issue and appreciate help with it. When I use this url
path('users/<username>/', views.user_detail, name='user_detail'),
If I click on the profile of any user I see their details but an unfollow button appears on their profile and not a follow button
If I use this url
path('users/<username>/follow_detail', views.follow_detail, name='user_detail'),
when I click on a profile I see the follow button but I see my profile. I went through and clicked on a few different profiles and it brings up my user_detail with the follow button.
So now what I need is for the profile of the actual member to appear with the follow button. Then I can work on what happens when that button is clicked.
This is what I have on my html page (in case that helps)
<!--Follow button / number of followers-->
<form action="/users/{{current_user}}/followers_count" method="POST">
{% csrf_token %}
<input type="hidden" name="user" value="{{current_user}}" readonly/>
<input type="hidden" name="follower" value="{{user.username}}" readonly/>
{% if follow_button_value == 'follow' %}
<input type="hidden" name="value" value="follow" readonly/>
<button class="btn btn-outline-success" type="submit">
Follow
</button>
{% else %}
<input type="hidden" name="value" value="unfollow" readonly/>
<button class="btn btn-outline-danger" type="submit">
Unfollow
</button>
{% endif %}
</form>
<div class="profile-stats">
<ul>
<li><span class="profile-stat-count">{{user_followers}}</span> followers</li>
<li><span class="profile-stat-count">{{user_following}}</span> following</li>
</ul>
</div>
I have something mixed up somewhere. I am seeing the profile of me the logged in user instead of the user detail of the actual user. I am just not sure what I need to change. Its probably very obvious to anyone who knows what they are doing!!!