1👍
✅
The problem is that you are not passing the pk
in the template. From the screenshot, if you look at the highlight line in the template it is clear that your URL is missing the keyword argument that is needed…
The same is also mentioned in the first line of the error page (with keyword args {})
Just mention it after the url name and it should work
{% url 'gallery:add-photo' photo.pk %}
or you could also do
{{ photo.get_absolute_url }}
Source:stackexchange.com