Den 20/12/2013 kl. 12.11 skrev Christian Schulz <mining.fa...@gmail.com>:

> in my views i have  method calls which might be take some time. It is 
> sufficient to return a simple message and request
> the result in another step.
> 
> I explore celery , but It might be to complex , because I have to use class 
> based task an have some difficulties  
> with the serializer's in different ways.
> 
> Know somebody a different strategy/simple lib?

Long-running processes do not belong in HTTP requests. You really want to move 
this to a separate process outside the web server.

Celery is the obvious choice as you will find lots of tutorials for Django, but 
depending on your use-case you could store the job in the database, and run a 
custom management command via cron once every minute to check if there is 
anything to do.

If you are having problems serializing, try to just pass the primary key(s) of 
whatever object(s) you want to process. Then have the task load these objects 
from the database.

Erik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B7073EFF-8AAE-4610-8C0C-CB25A19EA681%40cederstrand.dk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to