T
T
timkin12019-08-26 16:06:54
Django
timkin1, 2019-08-26 16:06:54

How to implement file download in Django?

Hello!
There was such question: how to force to give the file with the data from page at button click? I have implemented file generation. On the site page, the data, respectively, and the variables passed to the template engine change with each page refresh. And I need to download the generated file with the current values ​​of the variables displayed on the page when the button is clicked .
Example:
When the page is updated, a new password is generated each time in views.py, so I need to download a file with this password, and not a regenerated one, when clicking on a button on this page.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question