title: Django - Where to store temporary/preview models before writing to database?
body: <p>We have a CSV file that we are importing into a Django application, and then creating the appropriate models and relationships.</p>
  
  <p>At the first page, we have a file upload form where the user selects a file.</p>
  
  <p>We then parse the file, and return a second page showing them what would be created, any validation errors etc.</p>
  
  <p>The user can then decide whether to proceed or not (or possibly to correct any areas on-screen).</p>
  
  <p>What would be the best way of storing the temporary interim models, before it actually hits the database proper?</p>
  
  <p>The CSV file will be fairly big, possibly around 200 Kb in size, and create several hundred models.</p>
  
  <p>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?</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Anyhow, figured I'd also canvas the SO community, since there's a lot of bright Django people lurking here as well =).</p>
  
  <p>Cheers,
  Victor</p>