from django.urls import path
from . import views
app_name = 'infos'
urlpatterns = [
path('', views.home_page, name='index_view'),
path('members/', views.list_members, name='list_members'),
path('members/<int:id>/', views.view_member, name='view_member'),
path('members/<int:id>/photos/', views.show_photos, name='show_photos'),
]
def show_photos(request, id):
member = BandMembers.objects.get(pk=id)
member_id = member.pk
print(member_id)
photos = Photos.objects.get(band_member=member)
return render(request, 'infos/photos.html', { 'photos': photos, 'member': member_id})
{% extends 'base.html' %}
{% block title %}
Στοιχεία
{% endblock %}
{% block body %}
<div class="container">
{{ form.as_p }}
<a href="{% url 'infos:show_photos' id %}" class="btn btn-primary"> Φωτογραφίες </a>
</div>
{% endblock %}
我收到一个NoReserveMatch
错误。我究竟做错了什么?我一直在Stackoverflow,Youtube等处寻找时间,似乎我做得对。但是可以肯定,我不!!!!!!
我的错误在哪里?感谢大伙们 。