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

Key Error 'request' #65

Open
negativefix opened this issue Apr 6, 2015 · 2 comments
Open

Key Error 'request' #65

negativefix opened this issue Apr 6, 2015 · 2 comments

Comments

@negativefix
Copy link

I installed and configured django-disqus according to instructions in the documentation but somehow django view which I included disqus template tags gives the error below.

Django Version: 1.7.5
Exception Type: KeyError
Exception Value:    
'request'

Additionally, line with {% disqus_dev %} highlighted in the error log.

Am I missing something or is that an issue?

@arthurk
Copy link
Owner

arthurk commented Apr 6, 2015

Hey, could it be that you don't have django.core.context_processors.request enabled as a context processor? (https://docs.djangoproject.com/en/1.7/ref/templates/api/#django-core-context-processors-request)

@negativefix
Copy link
Author

Sorry for the late reply. As you suggested I enabled 'django.core.context_processors.request'. Additionally I defined a SITE_ID which is required by Sites Framework in my settings.py as below.

SITE_ID = 1
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.request',
)

My template renders without any error but now I am getting We were unable to load Disqus message on my local development environment although I am using {% disqus_dev %}. I switch back to non-django version of disqus to check what may be wrong. I saw that universal disqus code does not include disqus_ url. I am suspecting that my url config is the reason I am getting We were unable to load Disqus while using django-disqus.

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

No branches or pull requests

2 participants