简体   繁体   English

Django 太慢了? errno 32 损坏 pipe? dcramer-django-sentry-? static 文件夹?

[英]Django is sooo slow? errno 32 broken pipe? dcramer-django-sentry-? static folder?

I've been using Django 1.3 with Python 2.6 on Ubuntu 10.10.我一直在 Ubuntu 10.10 上使用 Django 1.3 和 Python 2.6。 I have 3 questions.我有 3 个问题。

  1. I recall having this problem on Windows 7 when I used Django a while ago.我记得当我不久前使用 Django 时,在 Windows 7 上遇到了这个问题。 However, I also remember that when I first used Django this problem didn't occur.但是,我还记得当我第一次使用 Django 时,并没有出现这个问题。

When I access Django via 127.0.0.1:8000 , after starting a brand new project, I can reach the site, but sometimes it takes a good 10-20 secs and sometimes more to reach it.当我通过127.0.0.1:8000访问 Django 时,在开始一个全新的项目后,我可以到达该站点,但有时需要 10-20 秒,有时甚至更长时间才能到达。 Also, on a project I've barely worked on, I have the same problems and also get errors like:此外,在我几乎没有参与过的项目中,我遇到了同样的问题,并且还遇到了以下错误:

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.此外,每当我收到错误时,我希望dcramer 的 django-sentry将错误记录在数据库中,但是当我将 go 放入 MySQL 并检查表格时,那里什么也没有。 I followed the instructions on the site to install the app.我按照网站上的说明安装了该应用程序。

  2. I placed this in my urls.py file:我把它放在我的 urls.py 文件中:

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

However, when I go to 127.0.0.1:8000/static/css.css I can't find the file I placed in the folder.但是,当我 go 到127.0.0.1:8000/static/css.css 8CBA22E28EB17B5F5C6AE2A266AZ 时,我找不到放在文件夹中的文件。 What did I do wrong?我做错了什么?

Thanks for all the help!感谢所有的帮助!

this issue is also discussed here Django + WebKit = Broken pipe这个问题也在这里讨论Django + WebKit = Broken pipe

These errors are the client closing the connection before it has a chance to fully send all data (I believe).这些错误是客户端在有机会完全发送所有数据之前关闭连接(我相信)。

There are certain areas of the stack, this being one of them, that Sentry currently can't log exceptions from.堆栈的某些区域,这是其中之一,Sentry 目前无法记录异常。 We're hoping to improve this in Sentry 2.0.我们希望在 Sentry 2.0 中改进这一点。

/Have you set STATIC_URL = '/static/' in your settings /您是否在设置中设置了 STATIC_URL = '/static/'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM