1

In my admin I have a form allowing to upload a file to fill the DB.

Parsing and filling the DB take a long time, so I'd like to do it asynchronously.

As recommended by several SO users I tried to install python-celery, but I can't manage to do it (I'm on Webfaction).

Is there any simple, easy-to-install alternative?

4

2 回答 2

1

如果 webfaction 支持 cron 作业,您可以创建自己的伪代理。您可以将长时间运行的任务保存到数据库和“任务”表中,这将允许您立即向用户返回响应。然后可能会有一个 cron 非常频繁地执行并查找未完成的任务并处理它们。

我相信这就是 django mailer 所做的 https://github.com/jtauber/django-mailer/

https://stackoverflow.com/a/1419640/594589

于 2012-09-20T18:07:09.877 回答
0

试试Gearman和它的python 客户端库

设置和运行 gearman 非常容易。尝试几个例子。

于 2012-11-14T09:31:00.870 回答