0

I write a project in django. I've got data from MS SQL called orders - there are few rows from the table. I would like to loop it, and each of them should render new tab '/print' with some context in order to create and download pdf. Like:

for o in orders:
    HttpResponseRedirect('/print')

Is this possible?

  • Possible duplication of [this question](https://stackoverflow.com/questions/5415600/how-to-open-url-in-new-tab-from-django). You can't do that from the server-side of the application. – Shayan Mar 17 '21 at 11:37
  • consider evil-app which opens 500000 tabs in your webbrowser – 404pio Mar 17 '21 at 11:53

1 Answers1

0

Don't you only have 1 page to edit all the elements? Then you could perhaps hardcode the link e.g.:

return HttpResponseRedirect(my_edit_url)

If this doesn't work and you need to go 2 pages back take a look at this post: How to redirect to previous page in Django after POST request