Django-facebook icon indicating copy to clipboard operation
Django-facebook copied to clipboard

ValueError thrown because context.get('FACEBOOK_APP_ID') returns none

Open billwjo opened this issue 10 years ago • 13 comments

I'm running Django 1.6 and I just upgraded to django_facebook 6.0.1 (in an attempt to fix this issue). However, when I try to connect to facebook/connect, it throws an ValueError with the message "Please specify a Facebook app id and ensure the context processor is enabled". I dug into the code a bit and it appears that context.get('FACEBOOK_APP_ID') returns none. I tried separately to run this (in my own view) and also got 'none'.

I have the settings.py setup as you described in your documentation: 'django_facebook.auth_backends.FacebookBackend' -> AUTHENTICATION_BACKENDS 'django_facebook.context_processors.facebook' -> TEMPLATE_CONTEXT_PROCESSOR 'django_facebook' -> INSTALLED_APPS FACEBOOK_APP_ID and FACEBOOK_APP_SECRET are both defined in settings.py.

Please let me know if you have any suggestion. Thanks.

billwjo avatar Jul 15 '14 01:07 billwjo

+1

clrke avatar Apr 11 '15 03:04 clrke

+1

fproldan avatar Apr 24 '15 18:04 fproldan

+1

cdchen avatar May 28 '15 13:05 cdchen

Same problem here Any idea?

iampbernardo avatar Jun 03 '15 03:06 iampbernardo

+1

floriango avatar Jun 10 '15 18:06 floriango

+1

riquellopes avatar Jul 09 '15 03:07 riquellopes

+1

Ryzzuh avatar Jul 10 '15 15:07 Ryzzuh

+1

polsinello avatar Jul 12 '15 14:07 polsinello

+1

leandrotocalini avatar Jul 29 '15 19:07 leandrotocalini

+1

mikahon avatar Jul 29 '15 22:07 mikahon

Dude I'm f'cking dying here.

mikahon avatar Jul 29 '15 22:07 mikahon

Django made changes to the how TEMPLATES are configured in settings.py. Please refer to https://docs.djangoproject.com/en/1.8/ref/templates/upgrading/#the-templates-settings You'll have to migrate these changes to your settings for the Django-Facebook to work.

Try the following change..

TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.contrib.messages.context_processors.messages', 'django.template.context_processors.facebook', 'django.template.context_processors.request', ], }, }, ]

Ryzzuh avatar Jul 29 '15 22:07 Ryzzuh

i use django.allauth now for facebook log in, which works fine

fl0g0 avatar Jul 30 '15 07:07 fl0g0