2016-09-12 4 views
0

Я добавляю аутентификации через Facebook и когда я бегу мой Localhost Я получаю эту ошибку в терминале:Джанго Нет модуль с именем backendssocial.apps.django_app.context_processors

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 

Когда я ГПГ, замерзнуть я вижу, что у меня есть питон-социально-аутентификации == 0.2.7, так что я не уверен, что вызывает все это.

Это части моего settings.py файла:

INSTALLED_APPS = [ 
    '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', 
] 
TEMPLATES = [ 
{ 
    'BACKEND': 'django.template.backends.django.DjangoTemplates', 
    'DIRS': [os.path.join(BASE_DIR, 'templates')], 
    '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', 
      'social.apps.django_app.context_processors.backends' 
      'social.apps.django_app.context_processors.login_redirect' 
     ], 
    }, 
}, 
] 
WSGI_APPLICATION = 'bookstore.wsgi.application' 

AUTHENTICATION_BACKENDS = (
    'social.backends.facebook.FacebookOAuth2', 
    'django.contrib.auth.backends.ModelBackend' 
) 
# Registration 
ACCOUNT_ACTIVATION_DAYS = 7 
REGISTRATION_AUTO_LOGIN = True 
LOGIN_REDIRECT_URL ='/store/' 

# Email settings 
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" 
EMAIL_HOST = "smtp.gmail.com" 
EMAIL_HOST_USER = "[email protected]" 
EMAIL_HOST_PASSWORD = "xx" 
EMAIL_PORT = 587 
EMAIL_USE_TLS = True 
DEFAULT_FROM_EMAIL = "[email protected]" 

# Social Auth - Facebook 
SOCIAL_AUTH_FACEBOOK_KEY = 'xx' 
SOCIAL_AUTH_FACEBOOK_SECRET = 'xx' 

Заранее спасибо за вашу помощь!

ответ

1

У вас не хватает одной запятой в TEMPLATES переменной:

'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' 
], 
+0

OMG никак. Не могу поверить, что ты нашел это так быстро! – Robby

Смежные вопросы