On Thu, Jun 9, 2011 at 12:50 PM, Sherif Shehab Aldin
<silentqu...@gmail.com> wrote:
> Actually that's what am doing, am saving the files with timestamp, The
> question is, do I create a daemon to check the dir and process new files in
> order, and if that's the best practice, how do I use Django environment in
> the daemon so I can import the models??
>

I'm not saying this is the best way to do this, but create a
management command, and then become a daemon. Django makes this easy:

Management commands:
https://docs.djangoproject.com/en/1.3/howto/custom-management-commands/

Becoming a daemon:
from django.utils.daemonize import become_daemon
become_daemon(our_home_dir=workdir, out_log=out_log, err_log=err_log)

Personally, I would use a MQ (celery, rabbitmq, django-celery) with
one worker, and push tasks to the worker.

Cheers

Tom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to