Django Popup window after submit post request not going to previous page

I have an add form.
in add form have a button to show popup form.
when popup form submit it’s not closing to previous and when clicking on cancel button it should be close the popup and going to previous add form.

When clicking on submit button in popup the message on top of popup is closing but it was on loading stage.

How to resolve it…