On Tue, Mar 13, 2012 at 8:54 PM, hack <scottma...@gmail.com> wrote:
> This stuff is killing me. LOL I think I just don't understand the
> urllib2 yet.
>
> I'm trying something very simple, but am having a terrible time
> figuring out how to get it to work in python an
Also, quick sort-of side-note:
I recommend checking out the python-requests library as an alternative
to urllib2
http://docs.python-requests.org
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
Are you using the development server? If so, how about sticking a
pdb.set_trace() at line 510 of
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py
to see what you're really getting?
On 3/13/12, hack <scottma...@gmail.com> wrote:
> Yes, I added @cs
Yes, I added @csrf_exempt and not I get a 500 error instead. I'm not sure
what the deal is.
On Tuesday, March 13, 2012 10:09:37 PM UTC-4, Matt Schinckel wrote:
>
> That response indicates you do not have permission to access that resource
> on that server. Are you sure you are hitting the
Hmmm, perhaps this might help: @csrf_exempt
On Tuesday, March 13, 2012 9:54:30 PM UTC-4, hack wrote:
>
> This stuff is killing me. LOL I think I just don't understand the
> urllib2 yet.
>
> I'm trying something very simple, but am having a terrible time
> figuring out how
That response indicates you do not have permission to access that resource
on that server. Are you sure you are hitting the correct URL?
You may want to look into requests, it is a nicer interface for interacting
with http servers.
Matt.
--
You received this message because you are
This stuff is killing me. LOL I think I just don't understand the
urllib2 yet.
I'm trying something very simple, but am having a terrible time
figuring out how to get it to work in python and django. All I want
to do is post to my site with params. Here is what I have:
def test(request
On Thursday, 11 August 2011 09:20:41 UTC+1, Igor Nemilentsev wrote:
>
> Hello everyone.
>
> I try:
>
> content = urllib2.urlopen('http://localhost:8080/').read()
>
> from inside some Django view(function)
> and http://localhost:8080/ is same Django server.
>
>
Hello everyone.
I try:
content = urllib2.urlopen('http://localhost:8080/').read()
from inside some Django view(function)
and http://localhost:8080/ is same Django server.
This command do not give me any answer but hang on.
But if url is foreign it is working.
Is there some cycle problem
ews that are meant to function like RESTful web services.
>
> I'm now in the process of writing a script that uses urllib/urllib2 to
> contact several of these services in order to download a series of
> very large files. I'm running into problems with 403: FORBIDDEN errors
> wh
and responses. All views are
written to redirect if the user isn't authenticated. It also has
several views that are meant to function like RESTful web services.
I'm now in the process of writing a script that uses urllib/urllib2 to
contact several of these services in order to download a series of
very
Hi,
you only have 1 forward slash after the ftp: protocol string, you need two:
'ftp:*/*/16.168.250.14:2189/RTVE/VIDEOS/Thisisit.wmv'
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
> file = 'ftp:/16.168.250.14:2189/RTVE/VIDEOS/Thisisit.wmv'
Looks like you are missing a second slash before the IP address there.
file = 'ftp://16.168.250.14:2189/RTVE/VIDEOS/Thisisit.wmv'
--
Scott Hebert
http://slaptijack.com/
--
You received this message because you are subscribed
Hi everybody:
I get an error when I used urllib2.urlopen() to open a remote file in a ftp
server, what I am trying to do is to make a view to force the browser to
download a file to disk instead of playing or displaying it. My code is the
following:
file = 'ftp:/16.168.250.14:2189/RTVE
On 27/07/2010 17:48, jerry wrote:
> Hi:
> I build a website and want to login the admin form by python code. I
> have disabled the CSRF in my project and use urllib2 to post data.
> here
On Wed, Jul 28, 2010 at 1:48 AM, jerry <jerryzhou2...@gmail.com> wrote:
> Hi:
> I build a website and want to login the admin form by python code. I
> have disabled the CSRF in my project and use urllib2 to post data.
>
Hi:
I build a website and want to login the admin form by python code. I
have disabled the CSRF in my project and use urllib2 to post data.
here are my codes:
import urllib
import
= {
'Referer': "http://%s/comments/; % (current_site.domain),
}
#Create the request
req = urllib2.Request(url, data, headers)
#Send the request
response = urllib2.urlopen(req)
And I made my receiving view more forgiving:
referrer = request.META.get('HTTP_REFERER', 'None')
Thanks!
-Brandon
--
t to a django form using
> urllib2.urlopen. I'm on revision 12523 of django trunk, so I used the
> @csrf_exempt decorator for the view that receives the post. When I
> tried to post to the form, it would return a 500 error, and not log
> the error in apache's error log for some reason. So I
urllib2.urlopen. I'm on revision 12523 of django trunk, so I used the
@csrf_exempt decorator for the view that receives the post. When I
tried to post to the form, it would return a 500 error, and not log
the error in apache's error log for some reason. So I decided to have
my receiving view return
; connection handlers, logging tools and god knows what will never have
> the same expectations as to how the sockets should behave.
> I didn't find a way to set a timeout for a specific connection when
> using urllib, urllib2 or even httplib - in python 2.3.
> So I ended
will never have
the same expectations as to how the sockets should behave.
I didn't find a way to set a timeout for a specific connection when
using urllib, urllib2 or even httplib - in python 2.3.
So I ended up using raw sockets :-( because then it is possible to set
a custom timeout without
The value was 20 (the unit is seconds). With the function call
removed, the calls completed successfully in much less time than 20
seconds, on the order of 1 second, so I don't thing the timeout was
actually kicking in.
--Ned.
--~--~-~--~~~---~--~~
You received
On 2/20/06, Ned Batchelder <[EMAIL PROTECTED]> wrote:
>
> I found the problem on my end. It was a call to
> socket.setdefaulttimeout(). The bug I had found but can't locate now
> was correct: if you call that socket function, urllib2 (and httplib)
> have very difficult t
I found the problem on my end. It was a call to
socket.setdefaulttimeout(). The bug I had found but can't locate now
was correct: if you call that socket function, urllib2 (and httplib)
have very difficult times completing reads.
I took out my call to setdefaulttimeout, and now it works great
On 2/20/06, Ned Batchelder <[EMAIL PROTECTED]> wrote:
I have some code in a Django view that makes a request on anotherserver. It uses urllib2 to make an SSL connection to the server andrequest a page. Here's the code:I dont know about https, but I am doing a lot of fetching page ove
I have some code in a Django view that makes a request on another
server. It uses urllib2 to make an SSL connection to the server and
request a page. Here's the code:
authb64 = ('%s:%s' % (username, password)).encode('base64').strip()
req = urllib2.Request('https://'+url
27 matches
Mail list logo