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 200405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:06:31+00:00 2026-05-11T17:06:31+00:00

I am working on a Django application which allows a user to upload files.

  • 0

I am working on a Django application which allows a user to upload files. I need to perform some server-side processing on these files before sending them on to Amazon S3. After reading the responses to this question and this blog post I decided that the best manner in which to handle this is to have my view handler invoke a method on Pyro remote object to perform the processing asynchronously and then immediately return an Http 200 to the client. I have this prototyped and it seems to work well, however, I would also like to store the state of the processing so that the client can poll the application to see if the file has been processed and uploaded to S3.

I can handle the polling easily enough, but I am not sure where the appropriate location is to store the process state. It needs to be writable by the Pyro process and readable by my polling view.

  • I am hesitant to add columns to the database for data which should really only persist for 30 to 60 seconds.
  • I have considered using Django’s low-level cache API and using a file id as the key, however, I don’t believe this is really what the cache framework is designed for and I’m not sure what unforeseen problems there might be with going this route.
  • Lastly, I have considered storing state in the Pyro object doing the processing, but then it still seems like I would need to add a boolean “processing_complete” database column so that the view knows whether or not to query state from the Pyro object.

Of course, there are also some data integrity concerns with decoupling state from the database (what happens if the server goes down and all this data is in-memory?). I am to hear how more seasoned web application developers would handle this sort of stateful processing.

  • 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-11T17:06:32+00:00Added an answer on May 11, 2026 at 5:06 pm

    We do this by having a “Request” table in the database.

    When the upload arrives, we create the uploaded File object, and create a Request.

    We start the background batch processor.

    We return a 200 “we’re working on it” page — it shows the Requests and their status.

    Our batch processor uses the Django ORM. When it finishes, it updates the Request object. We can (but don’t) send an email notification. Mostly, we just update the status so that the user can log in again and see that processing has completed.


    Batch Server Architecture notes.

    It’s a WSGI server that waits on a port for a batch processing request. The request is a REST POST with an ID number; the batch processor looks this up in the database and processes it.

    The server is started automagically by our REST interface. If it isn’t running, we spawn it. This makes a user transaction appear slow, but, oh well. It’s not supposed to crash.

    Also, we have a simple crontab to check that it’s running. At most, it will be down for 30 minutes between “are you alive?” checks. We don’t have a formal startup script (we run under Apache with mod_wsgi), but we may create a “restart” script that touches the WSGI file and then does a POST to a URL that does a health-check (and starts the batch processor).

    When the batch server starts, there may be unprocessed requests for which it has never gotten a POST. So, the default startup is to pull ALL work out of the Request queue — assuming it may have missed something.

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

Sidebar

Ask A Question

Stats

  • Questions 92k
  • Answers 92k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use width, height and position or offset: var elem =… May 11, 2026 at 6:28 pm
  • Editorial Team
    Editorial Team added an answer The run loop is automatically generated for you when you… May 11, 2026 at 6:28 pm
  • Editorial Team
    Editorial Team added an answer If by ".exe program" you mean a DLL, you could… May 11, 2026 at 6:28 pm

Related Questions

I have worked a bit with Django and I quite like its project/applications model
I am working on a web application using Python (Django) and would like to
I've been trying to build a simple prototype application in Django, and am reaching
Hey, i am currently working on a django app for my studies, and came
I'm working on a .NET application (VB 2008) that gets all of its data

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.