Re: load-on-startup equivalent in django?
You could use SimpleXMLRPCServer to create a client in your view.py with a function to call the server side, and pass the information over when done. See: http://docs.python.org/library/simplexmlrpcserver.html You'd need to have the server side running the whole time in the background, if you loose the connection, then it would need to be restarted otherwise you'll get a 'connection refused'. Martyn On Oct 20, 6:38 am, Ken wrote: > Hello all > I'm new to django and I have a question. > > I want to find a way to run some code periodicly in the background. > Because I have a fax device which will put incoming call data in the > database, I scan the database each 3 minutes for new incomings. > > In tomcat when I can make a servlet load on startup. I add > "0" in the web.xml file. This servlet > will be autoloaded when tomcat started and I then started the 3-min rountine > repeatly. > > I wonder how do I do the same in django framework. Or there is some > other way to run some background code periodicly? > > Thank you in advance. > > Ken -- 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.
Re: load-on-startup equivalent in django?
Another option is to create a command and run it via a cronjob On Thu, Oct 20, 2011 at 2:55 PM, kenneth gonsalves wrote: > > On Thu, 2011-10-20 at 13:38 +0800, Ken wrote: > > I wonder how do I do the same in django framework. Or there is some > > other way to run some background code periodicly? > > look at djcelery > -- > regards > Kenneth Gonsalves > > -- > 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. > -- 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.
Re: load-on-startup equivalent in django?
On Thu, 2011-10-20 at 13:38 +0800, Ken wrote: > I wonder how do I do the same in django framework. Or there is some > other way to run some background code periodicly? look at djcelery -- regards Kenneth Gonsalves -- 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.
load-on-startup equivalent in django?
Hello all I'm new to django and I have a question. I want to find a way to run some code periodicly in the background. Because I have a fax device which will put incoming call data in the database, I scan the database each 3 minutes for new incomings. In tomcat when I can make a servlet load on startup. I add "0" in the web.xml file. This servlet will be autoloaded when tomcat started and I then started the 3-min rountine repeatly. I wonder how do I do the same in django framework. Or there is some other way to run some background code periodicly? Thank you in advance. Ken -- 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.