Django Form resubmit issue when press back button [duplicate]

Django Form submit and link to the main page but when press back button, it shows data and ready to submits again. is here

def contact(request):
    if request.method == "POST":                      
        form = ContactsForm(request.POST, request.FILES)        
        if form.is_valid():   
            form = ContactsForm() 
            messages.success(request, 'Contact request submitted successfully.')      
            return HttpResponseRedirect(request.path_info) 

            messages.error(request, 'Invalid form submission.')
        form = ContactsForm() 

    projects = Projects.objects.filter(status=1).order_by('-updated_at')
    return render(request,'main/contact.html',{'contact':'current','projects':projects,'form':form})
Back to Top