Django Final/Landing Page

Solution for Django Final/Landing Page
is Given Below:

I am working on a Django based server and i take some attachments from the user and process it in this function

def get_request(request):
    df = pd.DataFrame()
    flag = 0
    # if this is a POST request we need to process the form data
    if request.method == 'POST':
            #Processing and generating results
            return render(request, 'result.html', {'data': to_send, 'file': df, 'flag': flag})

Initially, I wanted to render the results HTML page as above but instead I decided to send an email containing the results and send it to the user. I am able to send the results but I want to render a final page with some text while the results generate(might take some time depending on the size of the input). How can I do so without waiting for the processing to end and let it be in the background even if the user closes the tab?

It sounds like you might want to introduce a task queue to carry out the task on a separate thread and handle it separately.

I would recommend looking into Celery and Redis (as a message broker).
The way it would work is that once you have the data that you want to process, you sent a task to the task queue to perform and you immediately provide the user with a response.

Celery would then handle that task and carry out whatever it needs to in the background.

I followed this guide to do something similar for my company site:
https://www.youtube.com/watch?v=fBfzE0yk97k&list=PLOLrQ9Pn6caz-6WpcBYxV84g9gwptoN20&ab_channel=VeryAcademy