当前位置 : 主页 > 编程语言 > python >

django startapp报 maximum recursion depth exceeded

来源:互联网 收集:自由互联 发布时间:2022-06-18
报错截图如下: 解决办法:修改指定路径下的functools.py文件的def total_ordering(cls):方法: 原来的样子: convert = { '__lt__': [('__gt__', lambda self, other: other self), ('__le__', lambda self, other: not oth


报错截图如下:

django startapp报 maximum recursion depth exceeded_微信公众号

解决办法:修改指定路径下的functools.py文件的def total_ordering(cls):方法:

原来的样子:

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)]
}


修改后的样子:

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)]
}


改完之后即可创建app






更多内容详见微信公众号:Python研究所

django startapp报 maximum recursion depth exceeded_微信公众号_02



上一篇:Win7环境下Apache+mod_wsgi本地部署Django
下一篇:没有了
网友评论