django startapp报 maximum recursion depth exceeded

Posted phyger

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

  

  

 

以上是关于django startapp报 maximum recursion depth exceeded的主要内容,如果未能解决你的问题,请参考以下文章

win10启动django项目报错 Django RuntimeError: maximum recursion depth exceeded

django-admin startapp v/s python manage.py startapp [重复]

Django 1.5.1 - 运行 startapp 时缺少 Admin.py

Django学习——python manage.py startapp app-name新建app报错问题

Django学习过程问题分析

Python manage.py startapp 不起作用