【问题标题】:Django is sooo slow? errno 32 broken pipe? dcramer-django-sentry-? static folder?Django 太慢了? errno 32 管道破裂? dcramer-django-sentry-?静态文件夹?
【发布时间】:2011-08-16 09:31:06
【问题描述】:

我一直在 Ubuntu 10.10 上使用 Django 1.3 和 Python 2.6。我有 3 个问题。

  1. 我记得不久前使用 Django 时在 Windows 7 上遇到过这个问题。不过,我也记得我第一次使用 Django 的时候并没有出现这个问题。

当我通过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. 此外,每当我遇到错误时,我希望dcramer's django-sentry 将错误记录在数据库中,但是当我进入 MySQL 并检查表时,那里什么也没有。我按照网站上的说明安装了该应用程序。

  2. 我把它放在了我的 urls.py 文件中:

    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 时,我找不到我放在文件夹中的文件。我做错了什么?

感谢大家的帮助!

【问题讨论】:

    标签: python django performance


    【解决方案1】:

    这里也讨论了这个问题Django + WebKit = Broken pipe

    【讨论】:

      【解决方案2】:

      这些错误是客户端在有机会完全发送所有数据之前关闭连接(我相信)。

      堆栈的某些区域,这是其中之一,Sentry 目前无法记录异常。我们希望在 Sentry 2.0 中改进这一点。

      【讨论】:

        【解决方案3】:

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2013-04-16
          • 1970-01-01
          • 2013-09-05
          • 2021-12-05
          • 2023-03-11
          • 2015-08-16
          • 1970-01-01
          相关资源
          最近更新 更多