zoukankan      html  css  js  c++  java
  • django多次abort connection

    [27/Aug/2012 09:56:17] "GET /CPU/?graphtype=cpu&IP=175.41.196.144&timeType=minute HTTP/1.1" 200 2006
    Traceback (most recent call last):
      File "C:\Python27\lib\wsgiref\handlers.py", line 86, in run
        self.finish_response()
      File "C:\Python27\lib\wsgiref\handlers.py", line 127, in finish_response
        self.write(data)
      File "C:\Python27\lib\wsgiref\handlers.py", line 210, in write
        self.send_headers()
      File "C:\Python27\lib\wsgiref\handlers.py", line 268, in send_headers
        self.send_preamble()
      File "C:\Python27\lib\wsgiref\handlers.py", line 192, in send_preamble
        'Date: %s\r\n' % format_date_time(time.time())
      File "C:\Python27\lib\socket.py", line 324, in write
        self.flush()
      File "C:\Python27\lib\socket.py", line 303, in flush
        self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 10053] An established connection was aborted by the software in your host machine
    Traceback (most recent call last):
      File "C:\Python27\lib\SocketServer.py", line 582, in process_request_thread
        self.finish_request(request, client_address)
      File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "C:\Python27\lib\site-packages\django-1.4-py2.7.egg\django\core\servers\basehttp.py", line 139, in __init__
        super(WSGIRequestHandler, self).__init__(*args, **kwargs)
      File "C:\Python27\lib\SocketServer.py", line 641, in __init__
        self.finish()
      File "C:\Python27\lib\SocketServer.py", line 694, in finish
        self.wfile.flush()
      File "C:\Python27\lib\socket.py", line 303, in flush
        self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 10053] An established connection was aborted by the software in your host machine
    ----------------------------------------
    Exception happened during processing of request from ('127.0.0.1', 62723)

    至今不知道原因在哪,哪位高手可以帮忙看看呢?

    APPEND_SLASH = True

    这句在settings里的配置语句,使得post时候的url和urls.py中的url设计要小心,否则会出现找不到匹配url,导致post返回错误码或者找不到url匹配路径。

    比如

    APPEND_SLASH = False

    在url里配置 url(r'^test/', 'Monitor.views.test'),  在浏览器里输入127.0.0.1:8000/test/访问正常,但是127.0.0.1:8000/test就出现:

  • 相关阅读:
    webpack 模块化 原理
    nodejs 程序 调试
    inno打包教程
    原生xhr、fetch 请求的拦截。mock 技术原理
    package.json 字段说明
    npm 依赖包 的管理【即 node_modules目录的设计原理】
    现在浏览器、webview 中 css的兼容性问题。
    安卓APP(H5本地打包apk应用)
    npm 脚本
    linux系统 离线安装node和nginx(即npm包)
  • 原文地址:https://www.cnblogs.com/xiami303/p/2658214.html
Copyright © 2011-2022 走看看