Django为什么如此缓慢?errno 32破管道?dcramer-django-sentry-?静态文件夹?

9
我一直在使用Ubuntu 10.10上的Python 2.6和Django 1.3,有3个问题。
1.我记得以前在Windows 7上使用Django时也遇到过这个问题。但是,当我第一次使用Django时,没有出现这个问题。
2.当我通过127.0.0.1:8000访问Django,启动一个全新的项目后,有时需要等待10-20秒甚至更长时间才能访问该站点。在我几乎没有开发的项目中,我也遇到了同样的问题,并且还出现了错误。
Exception happened during processing of request from ('127.0.0.1', 47758)
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-1.3-py2.6.egg/django/core/servers/basehttp.py", line 570, 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
  1. Also, whenever I get an error I expect dcramer's django-sentry to log the error in the database, but when I go into MySQL and check the tables, there is nothing there. I followed the instructions on the site to install the app.

  2. I placed this in my urls.py file:

    url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/user/apache2/www/django/ecomstore/static',})
    

然而,当我访问 127.0.0.1:8000/static/css.css 时,我找不到我放在文件夹中的文件。我做错了什么?

感谢您的所有帮助!

3个回答

7

4

这些错误是由于客户端在完全发送所有数据之前关闭连接(我认为是这样)。

在堆栈的某些区域(包括此处),Sentry目前无法记录异常。我们希望在Sentry 2.0中改进此功能。


0

你在设置中是否设置了STATIC_URL = '/static/'?


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接