Re: The server failed after serving a video file.

2011-03-09 Thread Tom Evans
On Wed, Mar 9, 2011 at 11:29 AM, Kenneth Gonsalves
 wrote:
> On Wed, 2011-03-09 at 11:26 +, Tom Evans wrote:
>> These are to be expected in this sort of scenario. If you want to
>> support this sort of architecture, use a different hosting solution
>> for development, eg mod_wsgi, mod_fastcgi etc.
>
> you could even proxy nginx to devserver and get the best of both
> worlds ;-)

Note that this doesn't solve all the issues - the dev server can still
only handle one request at a time. It may solve the OPs issue, since
logically the video would be streamed from nginx, not from django, but
it would not solve a view trying to make a web service call to the
server the view is being served from.

Also note that nginx is not doing anything particularly clever here,
apache and other webservers are more than capable of acting as a
reverse proxy. If you already use apache, no need to learn nginx also.

Cheers

Tom

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



Re: The server failed after serving a video file.

2011-03-09 Thread Kenneth Gonsalves
On Wed, 2011-03-09 at 11:26 +, Tom Evans wrote:
> These are to be expected in this sort of scenario. If you want to
> support this sort of architecture, use a different hosting solution
> for development, eg mod_wsgi, mod_fastcgi etc. 

you could even proxy nginx to devserver and get the best of both
worlds ;-)
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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



Re: The server failed after serving a video file.

2011-03-09 Thread Tom Evans
On Wed, Mar 9, 2011 at 11:19 AM, balu  wrote:
> Hi all :)
>
> I'm trying to include a video into my webpage. The page is loading
> fine and the video I embedded is playing properly.
>
> But... after loading of page, the server unexpectedly stopped working
> and it is showing an error message as below. From then it is not
> serving the requests. Please let me know how to handle this.
>

The django dev server only supports one single connection. Once you
are streaming a video to your browser, that is your single connection,
and any further connections will time out.

In your dev server log you have a number of errors:

error: [Errno 104] Connection reset by peer
  The browser on the other end reset the connection - it got tired of waiting

error: [Errno 32] Broken pipe
  The webserver tried to write to a client that had disconnected

These are to be expected in this sort of scenario. If you want to
support this sort of architecture, use a different hosting solution
for development, eg mod_wsgi, mod_fastcgi etc.

Cheers

Tom

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



The server failed after serving a video file.

2011-03-09 Thread balu
Hi all :)

I'm trying to include a video into my webpage. The page is loading
fine and the video I embedded is playing properly.

But... after loading of page, the server unexpectedly stopped working
and it is showing an error message as below. From then it is not
serving the requests. Please let me know how to handle this.


[08/Mar/2011 02:36:52] "POST /exam/login/ HTTP/1.1" 302 0
[08/Mar/2011 02:36:52] "GET /exam/home/ HTTP/1.1" 200 1582
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 283, in run
self.finish_response()
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 323, in finish_response
self.write(data)
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 415, in write
self._write(data[offset:offset+chunk_size])
  File "/usr/lib/python2.6/socket.py", line 318, in write
self.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 104] Connection reset by peer

Exception happened during processing of request from ('127.0.0.1',
49573)
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 283, in
_handle_request_noblock
self.process_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 309, in
process_request
self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in
finish_request
self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 569, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.6/SocketServer.py", line 618, in __init__
self.finish()
  File "/usr/lib/python2.6/SocketServer.py", line 661, in finish
self.wfile.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 283, in run
self.finish_response()
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 323, in finish_response
self.write(data)
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 415, in write
self._write(data[offset:offset+chunk_size])
  File "/usr/lib/python2.6/socket.py", line 318, in write
self.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 104] Connection reset by peer

Exception happened during processing of request from ('127.0.0.1',
49574)
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 283, in
_handle_request_noblock
self.process_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 309, in
process_request
self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in
finish_request
self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 569, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.6/SocketServer.py", line 618, in __init__
self.finish()
  File "/usr/lib/python2.6/SocketServer.py", line 661, in finish
self.wfile.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe



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