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

KeyError 'request' in social share #36

Open
bl-deepakchawla opened this issue Dec 2, 2019 · 0 comments
Open

KeyError 'request' in social share #36

bl-deepakchawla opened this issue Dec 2, 2019 · 0 comments

Comments

@bl-deepakchawla
Copy link

bl-deepakchawla commented Dec 2, 2019

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',
            ],
        },
    },
]

 def get(self, request):
        from django.template import Context, Template

        t = Template('{% load social_share %} {% post_to_linkedin object.title object_or_url "Post to LinkedIn" %}')

        c = Context({'message': 'Your message'})
        html = t.render(c)
        return Response(html)
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

1 participant