Sunday, March 20, 2011

Re: Auto import files into database

On Sunday, March 20, 2011 1:04:46 AM UTC, Corey Farwell wrote:
So would it look something along these lines:

from app.models import NewModel
# parse csv data here
meow = NewModel(whatever = parsedData)
meow.save()

Where should this script live? Is there a general place django
developers keep these scripts? If I want this script to run every x
minutes, would a cron job be the best approach?

You probably want a custom manage.py script: http://docs.djangoproject.com/en/1.2/howto/custom-management-commands/

This can be run from the command line or as a cron job.
--
DR. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate