Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.8 warning "Required context processor django_facebook.context_processors.facebook wasnt found" #539

Open
troygrosfield opened this issue May 29, 2015 · 3 comments · May be fixed by #612

Comments

@troygrosfield
Copy link
Collaborator

Receiving the following warning which shouldn't be there in django 1.8:

Required context processor django_facebook.context_processors.facebook wasnt found

The TEMPLATE_CONTEXT_PROCESSORS setting is deprecated starting in django 1.8:

It was replaced in favor of a TEMPLATES setting where the dict needs to have context_processors defined as an options key:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(SITE_ROOT, 'templates')],
        'OPTIONS': {
            'context_processors': [
                'django.core.context_processors.request',
                'django.core.context_processors.media',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django_facebook.context_processors.facebook',
            ]
        },
    },
]

This line of code [1] is what needs to change:

context_processors = settings.TEMPLATE_CONTEXT_PROCESSORS
for context_processor in required:
    if context_processor not in context_processors:
        logger.warn(
            'Required context processor %s wasnt found', context_processor)

[1]

context_processors = settings.TEMPLATE_CONTEXT_PROCESSORS

@javipalanca
Copy link

For me worked to comment lines 39-41 in views.py:
# validation to ensure the context processor is enabled
if not context.get('FACEBOOK_APP_ID'):
message = 'Please specify a Facebook app id and ensure the context processor is enabled'
raise ValueError(message)

@jrabbit
Copy link
Contributor

jrabbit commented Oct 21, 2015

This seems to be resolved by #549 so master seems to work

jrabbit added a commit to jrabbit/Django-facebook that referenced this issue Jun 16, 2016
@Blutude
Copy link

Blutude commented Mar 18, 2019

I can't use this package on Django=2.0.7 because of that error. Any idea how to fix this?

@jrabbit jrabbit linked a pull request Mar 19, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants