maverick wrote:
> Hi, I have a django web application, I want to invoke a request of one
> URL inside this application, e.g.  "/getdata/", and capture the output
> of such URL and do some further processing.
>
> Of course I can do that by make a real request, however I feel this
> may not be the best solution, is there any internal way to invoke a
> request ?
>   
If the url is part of your Django project, just call the view function.
You can either instantiate a dummy request object to pass to it, or pass
it the one that you have available already. You'll get an response
object back, and you can take the content of the response object, and do
whatever you want with it.

I ran into something similar and worked out how to implement it. I
haven't actually done it yet, so I can't share any gotchas that might
come up.

Cheers!


Jeff Anderson

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to