问题描述
我在Ubuntu 10.10中一直使用Django 1.3和Python 2.6。我有3个问题。- 我记得在Windows 7上使用Django之前有这个问题。但是,我也记得当我第一次使用Django时,这个问题没有发生。
当我通过 127.0.0.1:8000
,在开始一个全新的项目后,我可以到达该网站,但有时候需要10-20秒的时间,有时更多的达到它。另外,在一个我几乎没有工作的项目中,我也有同样的问题,并且也会收到以下错误:
处理请求('127.0.0.1',47758)
追溯(最近的最后一次调用):
文件/usr/lib/python2.6/SocketServer.py,第283行,在_handle_request_noblock
self.process_request(request,client_address)
文件/usr/lib/python2.6/SocketServer.py,第309行,process_request
self.finish_request(request,client_address)
文件/usr/lib/python2.6/SocketServer.py,第322行,在finish_request
self.RequestHandlerClass(request,client_address,self)
文件/ usr / local / lib /python2.6/dist-packages/Django-1.3-py2.6.egg/django/core/servers/basehttp.py,第570行,__init__
BaseHTTPRequestHandler .__ init __(self,* args,** kwargs
文件/usr/lib/python2.6/SocketServer.py,第618行,__init__
self.finish()
文件/usr/lib/python2.6 /SocketServer.py,行661,完成
self.wfile.flush()
文件/usr/lib/python2.6/socket.py,第297行,flush
self._sock.sendall(缓冲区(data,write_offset,buffer_size))
错误:[Errno 32] Broken pipe
-
此外,每当我收到错误,我希望在数据库中记录错误,但是当我进入MySQL并检查表时,没有任何东西。我按照网站上的说明安装该应用程序。
-
我把它放在我的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
我找不到我放在文件夹中的文件。我做错了什么?
感谢所有的帮助!
p>此问题也在此讨论
I've been using Django 1.3 with Python 2.6 on Ubuntu 10.10. I have 3 questions.
- I recall having this problem on Windows 7 when I used Django a while ago. However, I also remember that when I first used Django this problem didn't occur.
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. 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
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.
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',})
However, when I go to 127.0.0.1:8000/static/css.css
I can't find the file I placed in the folder. What did I do wrong?
Thanks for all the help!
this issue is also discussed here Django + WebKit = Broken pipe
这篇关于Django很慢? errno 32断管? dcramer-Django的sentry-?静态文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!