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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:45:46+00:00 2026-05-23T10:45:46+00:00

We have a CSV file that we are importing into a Django application, and

  • 0

We have a CSV file that we are importing into a Django application, and then creating the appropriate models and relationships.

At the first page, we have a file upload form where the user selects a file.

We then parse the file, and return a second page showing them what would be created, any validation errors etc.

The user can then decide whether to proceed or not (or possibly to correct any areas on-screen).

What would be the best way of storing the temporary interim models, before it actually hits the database proper?

The CSV file will be fairly big, possibly around 200 Kb in size, and create several hundred models.

Should I store this in the database somewhere, and label those models “temporary”? It seems a bit heavy just for a confirm, and I’m not sure if it’s appropriate use of the database. Or is there some way we could store it in Django sessions? Or any other way to do it?

I mentioned this on django-users before, and they suggested there either using a separate DB, or storing it in MongoDB. I’m not quite sure the best way to persist a Django model to MongoDB in that way though.

They also mentioned I might need to use something like ZeroMQ or django-celery to handle the importing process asynchronously in case the web-server timed out during it.

Anyhow, figured I’d also canvas the SO community, since there’s a lot of bright Django people lurking here as well =).

Cheers,
Victor

  • 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-23T10:45:47+00:00Added an answer on May 23, 2026 at 10:45 am

    If this csv import process will be common and perpetual (ie used by many users and not limited for a brief period of time), I would prefer to incorporate the logic into the models: I’d modify the models to have a flag indicating the instance is active or pending (you may add deleted too). This can be complemented with multiple managers. The default manager may be modified to filter only active objects, whereas a second manager may fetch only pending objects. A job may be written to take care of the objects that have been pending for long.

    Otherwise (if this is a temporary situation), you may choose any medium you are comfortable with to persist the pending objects.

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

Sidebar

Related Questions

I have a CSV file I'm importing but am running into an issue. The
So I have my CSV file that I am importing to create new AD
I have a basic C# console application that reads a text file (CSV format)
I am importing a csv file into R using the sqldf -package. I have
I'm building an editor that works with .CSV files. I have the application importing
I have a .csv file that is frequently updated (about 20 to 30 times
I have a CSV file that holds about 200,000 - 300,000 records. Most of
I have a CSV file that has only 1 column, but has close to
I have a CSV file that is formatted like: 0.0023709,8.5752e-007,4.847e-008 and I would like
I have a CSV file that I'm working with, and all the fields are

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.