how to django to request a page of the other domain

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to django to request a page of the other domain

zinking

cross domain ajax request is not allowed ,so I decide to use proxy on
the server side
but I don't know how to finish this, anyone point me some url?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: how to django to request a page of the other domain

Dougal Matthews
It depends what data your fetching I suppose but you might just want to use urllib?

JavaScript triggers a view that makes a request to the remote server and outputs the result to your javascript.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/1 Albert <[hidden email]>

cross domain ajax request is not allowed ,so I decide to use proxy on
the server side
but I don't know how to finish this, anyone point me some url?




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: how to django to request a page of the other domain

Oli Warner
In reply to this post by zinking
Look at urllib2 (google)

You should be able to do something like
return HttpResponse(urllib2.urlopen('http://www.your-url.ext/uri'))


2009/4/1 Albert <[hidden email]>

cross domain ajax request is not allowed ,so I decide to use proxy on
the server side
but I don't know how to finish this, anyone point me some url?




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: how to django to request a page of the other domain

Doug Ballance
In reply to this post by zinking

It might be better to use the rewrite/proxy capability of your
webserver rather than try to proxy using django.  If you do end up
trying to do it in python, I found pycurl to be much easier to deal
with for any requests requiring cookies, authentication, or anything
besides a simple url get despite being it being advertised as having a
'somewhat steep learning curve'.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---