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

  • SEARCH
  • Home
  • 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 581625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:35:58+00:00 2026-05-13T14:35:58+00:00

I have the need to kick off a long-running process in response to a

  • 0

I have the need to kick off a long-running process in response to a form submission in django. Then, I’d like to be able to poll using ajax and have the view respond with the state of the process (started, stopped, or running). Additionally, I want to be able to stop the process.

so my view looks like this:

def start()
  . . . 
def stop()
  . . . 
def status()
  . . . 

This particular question has been addressed multiple times on S.O., but my situation is subtly different: I am looking for a solution that is entirely pythonic, does not require anything not found in stock django, and does not require the use of a database.

The closest thing I have found is this post. I have implemented the code, and streamlined it quite a bit, but it turns out that request.session is not global (two browsers have different sessions).

It might be that my problem could be solved by using something other than request.session to save the start/stop/status state, but I have no idea what that would be.

Another possibility I came across in my reading is django middleware, but according to this,

__init__() is called only once — at server startup — not for individual
requests

There is also a blog post here that talks about global state in django.
Any thoughts?

  • 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-05-13T14:35:59+00:00Added an answer on May 13, 2026 at 2:35 pm

    If the state needs to be accessible from any process, and you don’t want to store it in the database (and I can’t see why not, that’s the best place for it), you could store it in a temporary file on the filesystem.

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

Sidebar

Related Questions

I need NAnt to kick off a long running console app on the local
I have a need to kick off a Data Collector Set that I've predefined.
I have a scheduled task that I need to kick off by browsing to
I'm running a data import, using a Windows form to kick off the import
I have a long running job that updates 1000's of entity groups. I want
I need to find an easy way to kick off teammates from a server
I kick off 5 uploads (of varying size) via the BackgroundTransferService. I have the
I have a form set up to kick out entered information to the next
I'm programing a penalty kick off game (javascrit + CSS3) and I need your
I have an external library which has a method which performs a long running

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.