skip to navigation
skip to content

Not Logged In

django-oneall 0.1.3

Django Authentication support for OneAll. Provides unified authentication for 20+ social networks

Latest Version: 0.1.4

OneAll ( provides web-applications with a unified API for 20+ social networks.

django-oneall is a Django app providing allowing user authentication and management through OneAll


This package is new, and so far has been tested in a development of a small number of projects. Please be sure to test all edge-cases where this package is used with your application!


  1. django>=1.4 (Wasn’t tested on earlier versions, but might work)
  2. pyoneall==0.1

Implementation Overview

OneAll API documentation is available at However, in order to use pyoneall with your application, it’s enough to read the docs for the Connection API: Connection API Documentation.

For more information on pyoneall the OneAll API wrapper that this package relies on, check out It has more goodies you could use.

This package provides user authentication capabilities based on django.contrib.auth. It provides the following components:

  1. Authentication Backend
  2. An identity model which stores a cached copy of the user’s identity
  3. A callback view for the authentication process



Add this app to your project directory, or install via:

pip install django_oneall


Add django_oneall to INSTALLED_APPS, make sure you have django.contrib.auth enabled:

    # . . .

Add the authentication backend:

AUTHENTICATION_BACKENDS = ('django_oneall.auth.OneAllAuthBackend',)

Configure OneAll connection:


Configure behavior (these are good to go as they are here, so you can just copy-paste):

# This setting lets you decide which identity data you want stored in the User model.
# The keys stand for the fields in the User model, while the values are the expressions that will be evaluated
# as attributes of the identity object as received from OneAll. There can be more than one identity expression,
# in case different authentication providers have different data structures.
# Note that the usernames will default to the user_token, which is a UUID. You can override it with any other
# unique identity information
    'username': ('user_token',),
    'email': ('emails[0].value',),
    'first_name': ('name.givenName',),
    'last_name': ('name.familyName',),

# User identity is always cached on first authentication. However, if you want to spare an API call for users
# who are already known to your Django app, you can disable the refresh of cache for the second time they
# connect and onward.

# The OneAll cache table in the DB, where cached identities are stored
ONEALL_CACHE_TABLE = 'oneall_cache'

Add the following URL pattern to your urlpatterns tuple:

url(r'^oneall/', include('django_oneall.urls'))

This should enable you to use the callback view at /oneall/auth/


When embedding the body of the OneAll plugin inside your login template, set the callback_uri attribute to the URL of the OneAll callback view like so:{% url oneall_auth %}. The template might look like:

<script type="text/javascript">"social_login_container", {
        'providers' :  ['facebook', 'google', 'linkedin', 'twitter', 'yahoo'],
        'css_theme_uri': '',
        'grid_size_x': '1',
        'callback_uri': '{% url oneall_auth %}'

Notes and Stuff

After configuring, python syncdb is required.

Now users can authenticate and attain user privileges using their social accounts, without the need for you app to handle the registration.

Inside your views or any other Python code, you can access the user’s identity information like this:

user = User.objects.get(username='<user_token>')
identity = user.identity

identity is an instance of the OneAllUserIdentity model, which allows you access to cached user identity information, provided by the social network the user used to authenticate. The data provided varies between different social networks. vars(identity) will show you the user’s information.

You can create your own authentication views. django.contrib.auth.authenticate and django.contrib.auth.login will work seamlessly with OneAll if you’ve added django_oneall.auth.OneAllAuthBackend to your AUTHENTICATION_BACKENDS. You can find docs on that at Connection API Documentation, or take a look at the very simple code in provided in this package.


Copyright (c) 2013, Leandigo (

Released under the MIT License. See the LICENSE file for details.

File Type Py Version Uploaded on Size
django-oneall-0.1.3.tar.gz (md5) Source 2013-07-21 5KB
  • Downloads (All Versions):
  • 6 downloads in the last day
  • 113 downloads in the last week
  • 248 downloads in the last month