These stack traces remind me of what happens when the request is taking a
long time
and the user decides not to wait, stopping the browser load (in this case
maybe
control-C-ing out of wget.

So it sounds like the request is not completing, but that may be due to
your debugging
code (are you trying to use pdb.set_trace() when not using runserver?), or
you could have
an infinite loop.

Why not write a simple view that saves request.body to a file and returns
an empty or
simple 200 response.  Then you can examine the file at your leisure,
including reading
it into a stand alone python to play with ElemenTree or whatever.

I've not used request.body, but not that the body of an HTTP POST isn't
usually HTML
(or XML).  There are various "headers" in the beginning, each being a name,
a colon,
and a value, where the value can be multiple lines by indenting all but the
first line
(the one with name:).

The RFC 2616, for HTTP, may be stuffy, and have a lot of boiler plate in
the beginning,
but it's good reading.

Bill

On Mon, Mar 11, 2013 at 10:44 PM, lx <lxlenovos...@gmail.com> wrote:

> *hi: *
> *   I'm a new one in django, I' using the django recevice the data by
> POST.*
>
> *for examle:*
> """"
> wget -v --post-file=conf.xml http://192.168.23.21:8001/time/
> """"
>
> *this way can't show the wrong message, when I write the wrong code like
> this:*
> """"
>  conf_xml =  request.body
>  root = ET.fromstring(conf_xml)
>  root = tree.getroot()
> """"
> *the wrong messages is:*
> *
> *
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 86, in run
>     self.finish_response()
>   File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 127, in
> finish_response
>     self.write(data)
>   File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 215, in write
>     self._write(data)
>   File "/usr/local/lib/python2.7/socket.py", line 322, in write
>     self.flush()
>   File "/usr/local/lib/python2.7/socket.py", line 301, in flush
>     self._sock.sendall(view[write_offset:write_offset+buffer_size])
> error: [Errno 104] Connection reset by peer
> ----------------------------------------
> Exception happened during processing of request from ('192.168.23.21',
> 47107)
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/SocketServer.py", line 582, in
> process_request_thread
>     self.finish_request(request, client_address)
>   File "/usr/local/lib/python2.7/SocketServer.py", line 323, in
> finish_request
>     self.RequestHandlerClass(request, client_address, self)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/servers/basehttp.py",
> line 139, in __init__
>     super(WSGIRequestHandler, self).__init__(*args, **kwargs)
>   File "/usr/local/lib/python2.7/SocketServer.py", line 641, in __init__
>     self.finish()
>   File "/usr/local/lib/python2.7/SocketServer.py", line 694, in finish
>     self.wfile.flush()
>   File "/usr/local/lib/python2.7/socket.py", line 301, in flush
>     self._sock.sendall(view[write_offset:write_offset+buffer_size])
> error: [Errno 32] Broken pipe
>
>
> *the question is how to debug easily except  Web Page.*
> *
> *
> *thank you.*
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to