sachsure sachsure - 2 months ago 9
Python Question

Socio login in Django

I am trying to build social login in Django, but it is not working fine.

How am doing:

  1. Installed python-social-auth

  2. added this in INSTALLED_APPS:


  3. Migrated DB (with no errors)

  4. Added this in

    url('social-auth/',include('social.apps.django_app.urls', namespace='social')),

  5. Got Facebook keys and added this to AUTHENTICATION_BACKENDS and keys in


  6. Added this to template:

    <div class="social">
    <li class="facebook"><a href="{% url "social:begin" "facebook"%}">Sign in with Facebook</a></li>

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

But adding that dint work.

What more should I do?


In point six replace

href="{% url "social:begin" "facebook"%}"


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.