Why is my narrate_update_form template not showing? And why am I getting
TemplateDoesNotExist at /narration/7/edit/
narrate_update_form
My views.py is:
class NarrateUpdate(UpdateView):
model = Narrate
fields = ['title', 'body']
template_name = 'narrate_update_form'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['narrate'] = Narrate.objects.get(pk=self.kwargs['pk'])
return context
On my narrate template I have this button:
<a href="{% url 'edit-narration' narrate.pk %}" value="Update">Edit/Update</a>
On the narrate_update_form.html, I have:
{% extends 'base.html' %}
{% block body %}
<form method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Update">
</form>
{% endblock body %}
Can anyone help me?