Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8604291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:32:09+00:00 2026-06-12T02:32:09+00:00

this is a different aproach for the question I already asked Simultaneous multitasking in

  • 0

this is a different aproach for the question I already asked

Simultaneous multitasking in Django

so it will share the intro.


I have in my web project a time consuming function. While the function is doing its computations, a web page should be rendered informing the user that the results will be sent by email once the computation is done.

views.py:

def web_function(request):
    ...
    return HttpResponse(results_will_be_sent_by_mail.html)
    time_consuming_function()

Since the page that has to be rendered is quite simple, and it requires no return information from time_consuming_function() is there a way to skip multitasking and just somehow first render and show the page and than call time_consuming_function()?


Possible solution:

  1. When the input button is pressed on the page that precedes the calling of “web_function”, attach some javascript code which will render the temporary page?

Update

Ended up using celery. Wasn’t successful in experimenting with Ajax.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:32:10+00:00Added an answer on June 12, 2026 at 2:32 am

    A return statement in a function represents the end of that function.* Your snippet’s time_consuming function is outside the function’s scope and thus will never be reached.

    A solution for handling the task could be: celery which is well suited for wrapping functions as asynchronous tasks. If you must do things synchronous, why don’t you use ajax for this so you can atleast show the user what’s going on with a BeforeSend?

    *This is true for Python and most, if not all, object oriented programming languages

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question already but my friend said to take a different approach.
[Please note that this is a different question from the already answered How to
I'm re-asking this question but with a different framework this time. I have two
I know this question has been asked quite a few times, however, I have
Forgive me if this has already been asked elsewhere. I have a Scala syntax
Yes, I know. This question have been already replied in Where to store the
I am using jQuery fullcalendar plugin , I have tried altering this many different
This is similar to (but different from) this question . Here is some simple
this is a different question concerning: add a connection to database not working, asp.net
I have tried this a few different ways and it always seems to fail.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.