我正在尝试运行Django服务器,并且遇到以下问题。因此,我在Django上还很陌生,然后让我知道是否需要任何其他信息。这段代码对我来说真的很复杂,我要挑战自己同时运行多个应用程序。
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 2.2.2
Python Version: 3.6.4
Installed Applications:
['registration',
'mailqueue',
'el_pagination',
'social_django',
'django_inlinecss',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'main',
'users']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'social_django.middleware.SocialAuthExceptionMiddleware']
Traceback: File "/home/rnominato/anaconda3/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request) File "/home/rnominato/anaconda3/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request) File "/home/rnominato/anaconda3/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/rnominato/PycharmProjects/Liben_Feb_2020/main/decorators.py" in wrap 20. mode = Mode.objects.get(id=1) File "/home/rnominato/anaconda3/lib/python3.6/site-packages/django/db/models/manager.py" in manager_method 82. return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/rnominato/anaconda3/lib/python3.6/site-packages/django/db/models/query.py" in get 408. self.model._meta.object_name Exception Type: DoesNotExist at / Exception Value: Mode matching query does not exist.