I am trying to build social login in Django, but it is not working fine.
How am doing:
added this in INSTALLED_APPS:
'social.apps.django_app.default',
Migrated DB (with no errors)
Added this in urls.py:
url('social-auth/',include('social.apps.django_app.urls', namespace='social')),
Got Facebook keys and added this to AUTHENTICATION_BACKENDS and keys in settings.py:
'social.backends.facebook.Facebook2OAuth2',
Added this to template:
<div class="social">
<ul>
<li class="facebook"><a href="{% url "social:begin" "facebook"%}">Sign in with Facebook</a></li>
</ul>
</div>
But now when I click on Log in with Facebook, there's an error in template rendering : 'social' is not a registered namespace. I guess this is because social is not present in urls.py.
But adding that dint work.
What more should I do? thanks
In point six replace
href="{% url "social:begin" "facebook"%}"
with
href="{% url 'social:begin' 'facebook'%}"
I think you are running into a problem when the first "
in "social:begin"
ends the "
after href=
, since '
and "
are replaceable you can do this.