If are you going to choose A, take a look on Advanced Python Schedule (http://apscheduler.nextday.fi/). It's a python module that let you schedule some script to be executed periodically, it really makes the job easier.
On Dec 14, 3:27 pm, Tim Daniel <redarrow...@hotmail.com> wrote: > Thanks for answering, I think I'm going to go with 'A' too. > > Guilherme I've had already looked after django-cron but don't know why > but it doesn't seem to work well, I've tried to increment a simple > counter in the database every 30 seconds and it doesn't work(using the > development server with django 1.1.1.). Also I don't see features > there to execute a job only once or to kill it. > > On django-jits all their sites seem to be offline : "Page > "InstallAndConfig" Not Found", and looking at the comments on the > first and only issue/ticket it seems to be an abandoned and not > finished project. So it isn't a reliable solution. > > And django-notification is not the thing I'm looking for because it > seems to be just for sending notifications to a user in the moment. > > So I'm still looking for a solution with better performance and less > overhead than 'A'. > > Creecode what do you mean with "custom management commands"? I just > wrote a simple python script that can be called from bash like this > python myscript.py, inside it I set up the enviroment to be able to > call my models and perform actions using the simplicity of the django > webframework. There I just check the entries on my cron-db table, and > if its time I perform the corresponding action (maybe having a type > field defining actions like sendmail or delete_account). > > On 14 dic, 12:30, Guilherme Cavalcanti <guiocavalca...@gmail.com> > wrote: > > > > > Tim, recently I've used the solution A too. > > > Take a look on these plugins: > > >http://code.google.com/p/django-cron/http://code.google.com/p/django-... > > > Pay attention specially on django-jits, it uses a little different > > approach based on your argument (threads). > > > Excuse my bad english. > > > On Dec 12, 7:58 pm, Tim Daniel <redarrow...@hotmail.com> wrote: > > > > Just want to figure out if there is a smarter solution for handling > > > the following problem: > > > > 1. An action is performed by a user (Normal django behaviour handling > > > a request and giving a response). > > > 2. Two hours later I want an automatic action to be done. > > > > Solution A: Have a datetime field with an expiry date and say every 10 > > > minutes a cron job checks the DB table for expired entries and > > > performs the programed action. > > > > Solution B: Have an event triggered cronjob that only executes once > > > and is created from Django(Python), after the 2 hours passed it > > > performs the programmed action only on the required entry. > > > > So how can I implement solution B? Is there a posibility to create a > > > cron on a user action that executes only one time? > > > > NOTE: I don't want to rely on a thread that should stay alive for two > > > hours ore more inside the server memory. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.