Re: How can I parse and process the contents of an URL?

2008-01-31 Thread MariusB
Thank you all! Indeed, it was because I was using Django's internal server (runserver). When I tried any other url, it worked. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: How can I parse and process the contents of an URL?

2008-01-29 Thread Little_Grungy
Wondering if you were able to solve this one? Trying something similar, can you post the rest of the source, I'm a newb, thankyou lg On Jan 28, 11:19 pm, Michael Elsdörfer <[EMAIL PROTECTED]> wrote: > > but the page seems to load forever and I'm stuck! > > I'm pretty sure I ran into this before

Re: How can I parse and process the contents of an URL?

2008-01-28 Thread Michael Elsdörfer
> but the page seems to load forever and I'm stuck! I'm pretty sure I ran into this before, and IIRC it's because Django's runserver, which I assume you are using, can only handle one request at a time - try a different test url. Michael MariusB schrieb: > I'm trying to take a link as an arg

Re: How can I parse and process the contents of an URL?

2008-01-28 Thread Remco Gerlich
On Jan 28, 2008 5:28 PM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > def url_head(request): >c=urllib.urlopen(request.GET['url']) >content=c.read() > http://example.com/url_head?url=file:/etc/passwd It's very important to do some basic sanity checking on the url. Just saying :-) Remco

Re: How can I parse and process the contents of an URL?

2008-01-28 Thread Thomas Guettler
Am Sonntag, 27. Januar 2008 19:39 schrieb MariusB: > I'm trying to take a link as an argument, open it, read it's content > and then display the first 50 characters from it. > First of all, I've tried to put the code in the views.py, but I didn't > make it. Now I made a middleware component with t

How can I parse and process the contents of an URL?

2008-01-27 Thread MariusB
I'm trying to take a link as an argument, open it, read it's content and then display the first 50 characters from it. First of all, I've tried to put the code in the views.py, but I didn't make it. Now I made a middleware component with this code: import urllib2 from django.shortcuts import rend