我在我的虚拟机上安装了Python Social Auth并尝试运行makemigrations
并收到此错误:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/myenv/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 338, in execute_from_command_line
utility.execute()
File "/opt/myenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 312,
in execute
django.setup()
File "/opt/myenv/local/lib/python2.7/site-packages/django/__init__.py",
line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/myenv/local/lib/python2.7/site-packages/django/apps/registry.py", line 85,
in populate
app_config = AppConfig.create(entry)
File "/opt/myenv/local/lib/python2.7/site-packages/django/apps/config.py",
line 127, in create
"'%s' isn't a subclass of AppConfig." % entry)
django.core.exceptions.ImproperlyConfigured: 'social.apps.django_app.middleware.SocialAuthExceptionMiddleware'
isn't a subclass of AppConfig.
我在我的localhost上运行了相同的应用程序,它运行正常。我无法理解这个错误说的是什么。请帮忙。
答案 0 :(得分:5)
您似乎已在 settings.py 中将social.apps.django_app.middleware.SocialAuthExceptionMiddleware
添加到INSTALLED_APPS
。
您应该将其添加到MIDDLEWARE_CLASSES
。