MultiValueDictKeyError в /rapport
Есть ли решения этой проблемы в django? я пытаюсь вывести hex2 и он отмечает, что 'data' является многозначным ключом . но в моей консоли код работает нормально и выводит результат без проблем. Мне нужно понять, как решить эту проблему с отображением. спасибо
views.py
def search(request):
context = {}
hex1=""
hex2=""
if request.method == 'POST':
hex2, hex1 = request.POST['data'].split("+")
print(hex2,hex1)
context['hex2']=hex2
return render(request,"p33/rapport.html",context)
rapport.html
<table class="table">
<tbody>
<tr>
{%for hex in hex2.items%}
{% csrf_token %}
<tr class="table-row">
<td>{{hex}}</td></tr>
{%endfor%}
</tr>
</tbody>
</table>
</div>
urls.py
path('rapport',views.search,name="rapport"),