Django에 django-oauth2-provider를 설치하려고합니다.오류 받기 : django.core.exceptions.AppRegistryNotReady : django rest framework에 oauth2 provider를 설치하는 중에 앱이 아직로드되지 않았습니다.
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'hello_api',
'rest_framework.authtoken',
'provider',
'provider.oauth2',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'corsheaders.middleware.CorsMiddleware',
]
ROOT_URLCONF = 'hello_api2.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
오류 역 추적 : 마이그레이션하는 동안, 설치 및 settings.py를 구성한 후, 나는 같은 오류를 얻고있다
error: File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
django.setup()
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/provider/oauth2/__init__.py", line 1, in <module>
import backends
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/provider/oauth2/backends.py", line 2, in <module>
from .forms import ClientAuthForm, PublicPasswordGrantForm
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/provider/oauth2/forms.py", line 10, in <module>
from .models import Client, Grant, RefreshToken
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/provider/oauth2/models.py", line 23, in <module>
class Client(models.Model):
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/db/models/base.py", line 105, in __new__
app_config = apps.get_containing_app_config(module)
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 237, in get_containing_app_config
self.check_apps_ready()
File "/home/ravi/PycharmProjects/hello-api2/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
'django-oauth2-provider'를 사용하지 마십시오. 3 년 후에 업데이트되지 않았기 때문에 문제가 발생할 가능성이 큽니다. 귀하의 필요에 맞는 새로운 패키지를 계속 찾으십시오. –