[Django]-Append extra data to request.POST in Django

12👍

if request.method == 'POST':
    updated_request = request.POST.copy()
    updated_request.update({'credit_type': [credit_type]})
👤Andy

0👍

You can try to unpack the request.POST dictionary and add your own key-value pairs. This way you keep the original dictionary intact.

new_dict = {**request.POST, 'custom_key': custom_val}
👤Alcher

Leave a comment