2

djangoチュートリアルに従って、プロジェクトを作成し、チュートリアルで述べたようにmanage.py runserverを実行し、「RuntimeError:最大再帰深度をcmpで超えました」というエラーが発生しました。

これを修正する方法はありますか?

私はこれをエラーとして受け取りました:

モデルの検証...

>によって開始されたスレッドの未処理の例外
トレースバック(最後の最後の呼び出し):
  ファイル"/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py"、行92、inner_run
    self.validate(display_num_errors = True)
  ファイル"/Library/Python/2.7/site-packages/django/core/management/base.py"、行280、validate
    num_errors = get_validation_errors(s、app)
  get_validation_errorsのファイル"/Library/Python/2.7/site-packages/django/core/management/validation.py"、35行目
    get_app_errors()。items()の(app_name、error)の場合:
  get_app_errorsのファイル"/Library/Python/2.7/site-packages/django/db/models/loading.py"、行166
    self._populate()
  _populateのファイル"/Library/Python/2.7/site-packages/django/db/models/loading.py"、72行目
    self.load_app(app_name、True)
  ファイル"/Library/Python/2.7/site-packages/django/db/models/loading.py"、96行目、load_app
    models = import_module('。models'、app_name)
  import_moduleのファイル"/Library/Python/2.7/site-packages/django/utils/importlib.py"、35行目
    __import __(name)
  ファイル"/Library/Python/2.7/site-packages/django/contrib/auth/models.py"、行370、
    クラスAbstractUser(AbstractBaseUser、PermissionsMixin):
  ファイル"/Library/Python/2.7/site-packages/django/db/models/base.py"、213行目、__ new__
    new_class.add_to_class(field.name、copy.deepcopy(field))
  add_to_classのファイル"/Library/Python/2.7/site-packages/django/db/models/base.py"、行265
    value.contribute_to_class(cls、name)
  ファイル"/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py"、257行目、contribute_to_class
    cls._meta.add_field(self)
  ファイル"/Library/Python/2.7/site-packages/django/db/models/options.py"、179行目、add_field
    self.local_fields.insert(bisect(self.local_fields、field)、field)
  ファイル"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py"、56行目
    '__lt__':[('__ gt__'、lambda self、other:other
    '__lt__':[('__ gt__'、lambda self、other:other
    '__lt__':[('__ gt__'、lambda self、other:other
    '__lt__':[('__ gt__'、lambda self、other:other........................。
RuntimeError:最大再帰深度をcmpで超えました

Settings.py

DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
    # ('Your Name', 'your_email@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '',                      # Or path to database file if using sqlite3.
        # The following settings are not used with sqlite3:
        'USER': '',
        'PASSWORD': '',
        'HOST': '',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
        'PORT': '',                      # Set to empty string for default.
    }
}


ALLOWED_HOSTS = []


TIME_ZONE = 'America/Chicago'


LANGUAGE_CODE = 'en-us'

SITE_ID = 1


USE_I18N = True


USE_L10N = True
USE_TZ = True
MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)


STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

SECRET_KEY = '+8nn@%#%d8r4##x*t==ja=kbm(514bng1m47yesv1wlsu#%)h4'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

WSGI_APPLICATION = 'mysite.wsgi.application'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)


LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

urls.py

from django.conf.urls import patterns, include, url
home', name='home'),
    # url(r'^mysite/', include('mysite.foo.urls')),
    enter code here
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)
4

1 に答える 1