1. 程式人生 > >win10啟動django項目報錯 Django RuntimeError: maximum recursion depth exceeded

win10啟動django項目報錯 Django RuntimeError: maximum recursion depth exceeded

python

錯誤:Django RuntimeError: maximum recursion depth exceeded

原因出自Python\Lib\fuctools.py

convert = {    ‘__lt__‘: [(‘__gt__‘, lambda self, other: other < self),
               (‘__le__‘, lambda self, other: not other < self),
               (‘__ge__‘, lambda self, other: not self < other)],    ‘__le__‘: [(‘__ge__‘, lambda self, other: other <= self),
               (‘__lt__‘, lambda self, other: not other <= self),
               (‘__gt__‘, lambda self, other: not self <= other)],    ‘__gt__‘: [(‘__lt__‘, lambda self, other: other > self),
               (‘__ge__‘, lambda self, other: not other > self),
               (‘__le__‘, lambda self, other: not self > other)],    ‘__ge__‘: [(‘__le__‘, lambda self, other: other >= self),
               (‘__gt__‘, lambda self, other: not other >= self),
               (‘__lt__‘, lambda self, other: not self >= other)]
}12345678910111213141234567891011121314

改成

convert = {    ‘__lt__‘: [(‘__gt__‘, lambda self, other: not (self < other or self == other)),
               (‘__le__‘, lambda self, other: self < other or self == other),
               (‘__ge__‘, lambda self, other: not self < other)],    ‘__le__‘: [(‘__ge__‘, lambda self, other: not self <= other or self == other),
               (‘__lt__‘, lambda self, other: self <= other and not self == other),
               (‘__gt__‘, lambda self, other: not self <= other)],    ‘__gt__‘: [(‘__lt__‘, lambda self, other: not (self > other or self == other)),
               (‘__ge__‘, lambda self, other: self > other or self == other),
               (‘__le__‘, lambda self, other: not self > other)],    ‘__ge__‘: [(‘__le__‘, lambda self, other: (not self >= other) or self == other),
               (‘__gt__‘, lambda self, other: self >= other and not self == other),
               (‘__lt__‘, lambda self, other: not self >= other)]
}


本文出自 “塵” 博客,請務必保留此出處http://zhangpan.blog.51cto.com/2818271/1950281

win10啟動django項目報錯 Django RuntimeError: maximum recursion depth exceeded