码迷,mamicode.com
首页 > 移动开发 > 详细

django startapp报 maximum recursion depth exceeded

时间:2018-03-23 11:34:22      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:创建   图片   tools   ==   and   art   原来   报错   分享图片   

报错截图如下:

技术分享图片

解决办法:修改指定路径下的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

  

  

 

django startapp报 maximum recursion depth exceeded

标签:创建   图片   tools   ==   and   art   原来   报错   分享图片   

原文地址:https://www.cnblogs.com/phyger/p/8628821.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!