Images being served with django server but not getting dispalyed on webpage
im creating a website and everything was working fine until yesterday when
suddenly images on the webpage stopped getting displayed. The server seems
to GET the images but they are not getting displayed and I cant figure out
why. When i load the webpage, i get a placeholder for the image like its
going to load but then it goes away.
These are my configurations:
settings.py
CACHES = {
'default' : {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
MEDIA_ROOT = '/home/hammad/virt_env/virt1/gccFishing/media'
MEDIA_URL = '/media/'
Im using sorl-thumbnail, a django package for dispalying images. Using
this, I display an image in a template like this:
template.html
{% load thumbnail %}
{% thumbnail user.image "200x200" crop="center" as im %}
<img src="{{im.url}}" width="{{ im.width }}" height="{{ im.height }}">
{% endthumbnail %}
These are server messages when i load a webpage:
[14/Sep/2013 15:41:45] "GET / HTTP/1.1" 200 159218
[14/Sep/2013 15:41:45] "GET
/media/cache/c0/17/c017021609e735bdc53f402ae6009bae.jpg HTTP/1.1" 200
155657
[14/Sep/2013 15:41:47] "GET /saudi-arabia/ HTTP/1.1" 200 284186
[14/Sep/2013 15:41:47] "GET
/media/cache/e9/25/e925347688cc973ecc997f00b6ee0b83.jpg HTTP/1.1" 200
156198
[14/Sep/2013 15:41:47] "GET
/media/cache/a4/ac/a4aca3c7a23aeada770062e9519a8daa.jpg HTTP/1.1" 200
156731
[14/Sep/2013 15:41:47] "GET
/media/cache/0a/21/0a2118ecac84d6451f3dd39cd881d8bb.jpg HTTP/1.1" 200
156728
The images were working fine before i restarted my computer. After the
restart, this problem started, and along with this problem I started
getting these errors:
[14/Sep/2013 15:41:48] "GET
/media/cache/0a/21/0a2118ecac84d6451f3dd39cd881d8bb.jpg HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 46531)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 593, in
process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File
"/home/hammad/virt_env/virt1/local/lib/python2.7/site-packages/django/core/servers/basehttp.py",
line 150, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
I googled for the error and found out its something of a browser issue.
Please give me your views as to what is happening here.
Thanks in advance
No comments:
Post a Comment