Closed mindobiee closed 4 years ago
Can I work on this issue? If yes are there any guidelines for contribution?
Thanks, but I don't understand your context..."guidelines for contribution"
@mindobiee are there any steps to follow while documenting the code or anything like that
@zair07 I got it, but now when I try to run server and go to login page, it doesn't appear, either. I think it get wrong since I change some codes to figure out above issue...
this is what I changed...
from django.conf.urls import url
from . import views
from django.conf.urls.static import static
from django.conf import settings
app_name = "member"
urlpatterns = [
url('join/', views.create_user, name="join"),
url('login/', views.sign_in, name="login"),
url('logout/', views.sign_out, name='logout'),
url('delete/',views.delete, name='delete'),
url('change_password/',views.change_password,name='change_password'),
url('profile/',views.profile, name='profile'),
url('follow/',views.follow, name='follow'),
url('user_list/',views.UserList, name='Userlist'),
url('people/
2. change urls where they are used
- something like below @ "template\home\navbar"
```html
<div class="dropdown-menu">
<a class="dropdown-item" href="{% url 'member:login' %}">Login</a>
<a class="dropdown-item" href="{% url 'member:join' %}">Register</a>
</div>
And, the steps what I encounter first, is... 1) I wanted to add "following" function 2) make a logic in views.py 3) make a template of "people.html" which has a follow button (and includes the information of the individual)
{% extends 'home/base.html' %}
{% block container %}
<div class="container">
<div class="row">
<div class="col-3">
<h1>
{% if people.photo %}
<img src="{{ people.photo.url }}" width= 70,
alt="{{ people.photo}}">
{% endif %}
{{ people.username }}
</h1>
</div>
<div class="col-9">
<div>
<strong>{{ people.username }}</strong>
{{ people.followers.all }}
{% if user != people %}
{% if user in people.followers.all %}
<a href="{% url 'follow' people.id %}">UnFollow</a>
{% else %}
<a href="{% url 'follow' people.id %}">Follow</a>
{% endif %}
{% endif %}
</div>
<div>
<strong> Followers: </strong> {{ people.followers.count }}
<strong> Followings: </strong> {{ people.followings.count }}
</div>
</div>
</div>
</div>
{% endblock %}
4) and make a link to "photo_list.html" through tag
<a href="{% url 'member:people' object.user.username %}">
<p class="card-text">{{ object.user }}</p>
</a>
5) add urls
url('people/<str:username>/',views.people, name="people")
and when I go to page (/photo) that is linked to page "photo_list.html", the issue appears...
@mindobiee Ok I will look at it
Its working fine on my pc. have you committed the changes that you made?
Yes, I pushed the new version right before
@zair07 I am deleting the "app_name" : It seems to be working anyway and the problem is this one.
NoReverseMatch at /photo/
Reverse for 'people' with arguments '('rosa',)' not found. 1 pattern(s) tried: ['member/people/<str:username>/']
이전에 수정한 내용 follow기능을 구현한 본인 페이지로 연결하는 url 태그를 photo_list.html에서 수정 후 생긴 오류
설정해준 url photo_list.html :
<a href="{% url 'member:people' object.user.username %}">
member\url.py :url('people/<str:username>/',views.people, name="people")
연결된 view