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. Views.py is here

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

        else:
            messages.error(request, 'Invalid form submission.')
            
            
    else:
        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