• 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就出现:

  • 相关阅读:
    数组按行访问和按列访问的区别
    解决github中图片无法显示问题的策略
    C#验证帮助类(手机号、身份证等)
    WPF圆角按钮样式
    弗洛伊德的本我、自我与超我概念
    KEPServerEX OPCUA服务器地址配置
    C#List的一些操作
    梦、清醒梦、梦魇
    类说明head部格式
    阅读笔记20222
  • 原文地址:https://www.cnblogs.com/xiami303/p/2658214.html
Copyright © 2020-2023  润新知