send loop result data

hello every one , i have a probelem that i couldn’t fixet , i need to create a progress bar in the frontend that show the progress of the scraping data, when i use return it stop the api , any solution please
Screenshot from 2022-11-17 16-00-26

First a side note: When you want to post code (or templates, error messages, tracebacks) here to get assistance, please do not post images or links to images. Post the code here, between lines consisting of three backtick () characters to maintain formatting. This means you'll have a line of \``, then your code (or template, etc), then another line of ```.

To address your question, the easiest way of doing this is to track your progress by storing some value in the user’s session (if it’s only that specific user needing to track this), then writing some JavaScript for the front end to poll on a different view to retrieve that progress.

Then when you get your response, you can stop that polling process.