I have django form which displays the check boxes.After selecting the checkboxes user will click submit button which will executes request.POST part of the view.py and returns PDF file. Now after returning the PDF file how can i refresh the the same page?
views.py
if request.POST:
generate PDF file using reportlab tool
return PDF
else:
return template which consist of django form
Now here on request.POST i can get the PDF file, at the same time how can i refresh the page?
After returning the PDF i want to refresh the same page. Any solution?
Thanks in advance
The comments are correct, this has nothing to do with any server-side language, so i’ll try to give you directions on how to solve this instead:
A very common solution is that you do not return the PDF directly, but a HTML page that says something like “Your download will begin shortly”. This page can use a link or a bit of javascript to open the PDF file in a new browser window. After that the page can remain open or automatically redirect elsewhere.