Python Django没有名为backendssocial.apps.Django_app.context_处理器的模块
我正在通过facebook添加身份验证,当我运行我的本地主机时,终端中出现以下错误:Python Django没有名为backendssocial.apps.Django_app.context_处理器的模块,python,django,facebook,Python,Django,Facebook,我正在通过facebook添加身份验证,当我运行我的本地主机时,终端中出现以下错误: xx-MacBook-Pro:bookstore xx$ python manage.py runserver /Library/Python/2.7/site-packages/django/db/models/fields/subclassing.py:22: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.fro
xx-MacBook-Pro:bookstore xx$ python manage.py runserver
/Library/Python/2.7/site-packages/django/db/models/fields/subclassing.py:22: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
RemovedInDjango110Warning)
/Library/Python/2.7/site-packages/django/db/models/fields/subclassing.py:22: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
RemovedInDjango110Warning)
Performing system checks...
/Library/Python/2.7/site-packages/social/apps/django_app/urls.py:12: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got auth). Pass the callable instead.
name='begin'),
/Library/Python/2.7/site-packages/social/apps/django_app/urls.py:14: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got complete). Pass the callable instead.
name='complete'),
/Library/Python/2.7/site-packages/social/apps/django_app/urls.py:17: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got disconnect). Pass the callable instead.
name='disconnect'),
/Library/Python/2.7/site-packages/social/apps/django_app/urls.py:19: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got disconnect). Pass the callable instead.
'disconnect', name='disconnect_individual'),
/Library/Python/2.7/site-packages/social/apps/django_app/urls.py:19: RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.
'disconnect', name='disconnect_individual'),
System check identified no issues (0 silenced).
September 12, 2016 - 19:22:13
Django version 1.9, using settings 'bookstore.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
我猜这篇文章的下半部分只是说Django的新版本会有所不同。我还猜测,上面的部分是说,有一个警告导致它。但是,当我实际转到本地主机时,会出现以下错误:
Request Method: GET
Request URL: http://localhost:8000/store/
Django Version: 1.9
Python Version: 2.7.10
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'social.apps.django_app.default',
'registration',
'store']
Installed 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.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
149. response = self.process_exception_by_middleware(e, request)
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/rseck/Desktop/stoneriverelearning/bookstore/store/views.py" in store
17. return render(request, 'store.html', context)
File "/Library/Python/2.7/site-packages/django/shortcuts.py" in render
67. template_name, context, request=request, using=using)
File "/Library/Python/2.7/site-packages/django/template/loader.py" in render_to_string
97. return template.render(context, request)
File "/Library/Python/2.7/site-packages/django/template/backends/django.py" in render
95. return self.template.render(context)
File "/Library/Python/2.7/site-packages/django/template/base.py" in render
204. with context.bind_template(self):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py" in __enter__
17. return self.gen.next()
File "/Library/Python/2.7/site-packages/django/template/context.py" in bind_template
256. processors = (template.engine.template_context_processors +
File "/Library/Python/2.7/site-packages/django/utils/functional.py" in __get__
33. res = instance.__dict__[self.name] = self.func(instance)
File "/Library/Python/2.7/site-packages/django/template/engine.py" in template_context_processors
105. return tuple(import_string(path) for path in context_processors)
File "/Library/Python/2.7/site-packages/django/template/engine.py" in <genexpr>
105. return tuple(import_string(path) for path in context_processors)
File "/Library/Python/2.7/site-packages/django/utils/module_loading.py" in import_string
20. module = import_module(module_path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py" in import_module
37. __import__(name)
Exception Type: ImportError at /store/
Exception Value: No module named backendssocial.apps.django_app.context_processors
提前感谢您的帮助 模板中缺少一个逗号变量:
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'social.apps.django_app.context_processors.backends' <--- MISSING COMMA
'social.apps.django_app.context_processors.login_redirect'
],
“上下文处理器”:[
“django.template.context_processors.debug”,
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'social.apps.django_app.context_processors.backends'
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'social.apps.django_app.context_processors.backends' <--- MISSING COMMA
'social.apps.django_app.context_processors.login_redirect'
],