Framework Django. I am trying to create a link to the profile of each user (doctor) by creating an automatic url by his id. an error appears: Reverse for 'doctor' with no arguments not found. 1 pattern (s) tried: ['doctor / (? P [^ /] +) / $']
I suppose I need to add a second parameter to the template link, but I can't figure out that "{% url 'doctor' ??%}"
html
..."{% url 'doctor' %}"...
view.py
def doctor(request, pk):
doctors = Doctor.objects.get(pk)
return render(request, 'main/doctor.html', {'doctors': doctors})
urls
path('doctor/<str:pk>/', views.doctor, name='doctor'),