On Tue, 2007-03-13 at 13:36 +0000, Nathan Harmston wrote: > Hi, > > I was wondering if anyone had added a web services client to django. > Ie when a user makes a request,
"Web service" is an extremely generic term, so you aren't really asking a specific question here. > it is processed by django and then a web service is invoked and the > results send back. Has anyone developed any frameworks or apps which > do this? Nothing special is really required. You can do whatever you want inside a view function and there is a view for every single URL the application can handle. So you would only need to write a view that does whatever processing you want to. It's difficult to be more specific than that because, as I said "web services" can mean anything. For each particular case, the design work comes down to working out which URLs correspond to which views. There are some pages in the wiki giving examples of how people have thought about hooking up xml-rpc calls through Django. Implementing REST URL schemes is almost trivial (at the URL mapping level), since it's just pattern matching and view dispatching. All the hard work lies in writing the view function to do the real heavy lifting and that varies on a case-by-case basis. > How can I deal with invocations/jobs which take a long time i.e > several hours, and still enable the user to come back later and view > the result of the job from the web service. Would I have to create > some kind of job manager within my models to allow this and spawn a > thread to deal with the web service stuff. This has been discussed in a lot of other threads on this list (search for "long running processes" might be one place to look). Basically, anything that prevents the view from returning as fast as possible is a bad idea, because the client is waiting. So if it really is going to take a long time, the view should just shove the request in a queue and some other (external) process will come along and run items from the queue periodically. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---