Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7716385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:37:26+00:00 2026-06-01T02:37:26+00:00

I am trying to use django-social-auth to implement google openid login into my app,

  • 0

I am trying to use django-social-auth to implement google openid login into my app, my problem is that I get this error:

TemplateSyntaxError at /login
Caught ImportError while rendering: cannot import name get_backend
Request Method: GET
Request URL:    #############################
Django Version: 1.3.1
Exception Type: TemplateSyntaxError
Exception Value:    
Caught ImportError while rendering: cannot import name get_backend
Exception Location: /home/group018/web/WSProject/social_auth/views.py in <module>, line 19
Python Executable:  /usr/bin/python2.7
Python Version: 

At the exception location you can see the hierarchy of my project.

The view.py file is as follows:

from functools import wraps

from django.http import HttpResponseRedirect, HttpResponse,HttpResponseServerError
from django.core.urlresolvers import reverse
from django.contrib.auth import login, REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.utils.importlib import import_module
from django.views.decorators.csrf import csrf_exempt

from WSProject.social_auth.utils import sanitize_redirect, setting, log,backend_setting, clean_partial_pipeline
from WSProject.social_auth.backends import get_backend

DEFAULT_REDIRECT = setting('SOCIAL_AUTH_LOGIN_REDIRECT_URL') or setting('LOGIN_REDIRECT_URL')
LOGIN_ERROR_URL = setting('LOGIN_ERROR_URL', setting('LOGIN_URL'))
RAISE_EXCEPTIONS = setting('SOCIAL_AUTH_RAISE_EXCEPTIONS', setting('DEBUG'))
PROCESS_EXCEPTIONS = setting('SOCIAL_AUTH_PROCESS_EXCEPTIONS','social_auth.utils.log_exceptions_to_messages')


def dsa_view(redirect_name=None):

.
.
.

the function get_backend is defined in WSProject/social_auth/backends/__init__.py and I have tried to import it as:

from WSProject.social_auth.backends.__init__ import get_backend

But it doesn’t work… any idea?

Note that the import below to the one I said is working

SOLVED: Finally I did it, the problem was the libraries, they were not correctly installed as jpic said.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:37:27+00:00Added an answer on June 1, 2026 at 2:37 am

    Did you try this ?

    from social_auth.backends import get_backend
    

    You should not hardcode the name of your project in your code. That makes the code less portable.

    If that doesn’t work, then you haven’t install django-social-auth correctly. Fix your setup:

    1. Create a virtualenv, in the parent directory of your project seems fair: virtualenv /path/to/venv

    2. Activate the virtualenv: source /path/to/venv/bin/activate

    3. Install an app ie. from git: pip install -e git+git://github.com/omab/django-social-auth.git#egg=social_auth

    I also wrote a more detailed article on django, virtualenv and pip which should be of your interrest.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pretty new to Django and trying to use django-social-auth in my Django
So I'm trying to use the django 1.1 template engine with the google app
How can I use django.auth.views.login? I am trying to make a user login but
I'm trying to use the Django nonrel project for google app engine. I setup
I have a small app I'm working on where I'm trying to use Django's
I am trying to use the django send_mail method. I am running into 2
I'm trying to use iexact in my Django app. I have items in my
I've been trying to use Django-appengine to write a small web app, but I
I'm trying to use django-reversion on a project that also uses a GenericForeignKey. I
I'm trying to use the django-voting tutorial from this blog: http://new.justinlilly.com/blog/2008/nov/04/django-voting-a-brief-tutorial/ to get a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.