Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Guilherme Leal
Puting plain, you just need to execute a POST request on the client side. That makes aviable the content on the request.POST property on your client side view. Wich tecnology you use to make the post request doesnt matter. The only thing you need to keep in mind is when you "navigate" through

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread steve malise
I want to display HTTP POST data from client side to on the server side and what am supposed do to achieve? On Mon, May 11, 2015 at 3:31 PM, Jani Tiainen wrote: > Hi, > > Sounds like you're mixing up terms and technologies here and really you > are trying something that

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Jani Tiainen
Hi, Sounds like you're mixing up terms and technologies here and really you are trying something that Django was never designed for. It would be really helpful to know what are you really trying to do, instead of just trying techniques that may or may not work for your case. On Mon, 11 May

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Guilherme Leal
Just to clarify, in your browser, if you simply "navigate" to the url of your view, the browser will issue a GET to the server. If you write the JavaScript function, you can specify the method of your request... preaty much the same thing as you did in the exemple that you sent. Its fairly

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread steve malise
Meaning write JavaScript code to make a request? how can achieve it other than writing JavaScript code? On Mon, May 11, 2015 at 3:13 PM, Guilherme Leal wrote: > The "navigation" of your browser always performs a GET method. If you're > trying to test that kind of request

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread Guilherme Leal
The "navigation" of your browser always performs a GET method. If you're trying to test that kind of request in the browser, the best aproach would be open the JavaScript and make the request there. 2015-05-11 10:09 GMT-03:00 steve malise : > client code: > import httplib >

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-11 Thread steve malise
client code: import httplib import urllib data = urllib.urlencode({'data':'data1'}) conn = httplib.HTTPConnection(myipaddr) headers = {"Content-type":"application/x-www-form-urlencoded", "Accept":"text/plain", "Content-Length:":len(data)}

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-07 Thread Thomas Levine
On 07 May 16:00, steve malise wrote: > The error comes when i runserver and send data from another computer to > django,then i get this "code 400, message Bad request syntax ( data from > another computer)" This is because On 07 May 11:42, Tom Evans wrote: > Eurgh. Your hand-crafted HTTP request

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-07 Thread steve malise
What i am trying to do is run python script(client side) on another computer which is on same network with my computer,then receive data from another computer with the django(which is running on my computer(server side)).i am using built-in "runserver". The error comes when i runserver and send

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-07 Thread Tom Evans
On Thu, May 7, 2015 at 3:00 PM, steve malise wrote: > What i am trying to do is run python script(client side) on another computer > which is on same network with my computer,then receive data from another > computer with the django(which is running on my computer(server

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-07 Thread Tom Evans
On Thu, May 7, 2015 at 12:48 PM, steve malise wrote: > where can i write web server? > Why do you want to? Django is a web application, it is hosted inside webservers, typically using WSGI. Typically, you would use one of the many webservers that can host wsgi applications

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-07 Thread steve malise
where can i write web server? On Thu, May 7, 2015 at 12:42 PM, Tom Evans wrote: > On Thu, May 7, 2015 at 9:24 AM, steve malise wrote: > > > > client side code: > > data = "message" > > try: > > clsocket = socket.socket(socket.AF_INET,

Re: Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-07 Thread Tom Evans
On Thu, May 7, 2015 at 9:24 AM, steve malise wrote: > > client side code: > data = "message" > try: > clsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > clsocket.connect(('192.168.2.2', 8000)) > print("Connection has been Made") >

Sending Data from client side(another computer) to Django(my computer) using Socket library

2015-05-07 Thread steve malise
client side code: data = "message" try: clsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) clsocket.connect(('192.168.2.2', 8000)) print("Connection has been Made") clsocket.send("POST / HTTP/1.1 "+ data) clsocket.close() except: