Django open badge integration
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Django Open Badge Integration


pip install -e git://


Step 0: Include django_obi in your setting file's INSTALLED_APPS.

While you're mucking around in there, include an additional setting, something resembling the following:

    'hub': '',
    'badge_getter': 'users.badges.get_awarded_badges',


    (r'^obi/', include('django_obi.urls')),

Be sure to run the test suite afterwards and make sure everything is kosher.

Badge Getter


The badge getter is going to get called a little something like this:

def some_view(request):
    user = request.user
    if user.is_authenticated():
        badges = badge_getter(user)

Your badge_getter method should take a User object and know how to get awarded badges from it.


The badge processer expects badge_getter to output a dictionary looking something like this:

    'proud_js_expert' : {
        'name' : 'JavaScript Expert',
        'evidence': '',
        'image': '',
        'description': 'Awarded for being totally rad at JavaScript',
        'criteria': '',
    'ashamed_cobol_master': { ... },
    'reluctant_java_user': { ... },

You are welcome to include other information in the dictionary; at the moment it will be ignored. In future versions it will likely be included as extra metadata passed to the hub.


Important Note!

The authenticated user must have an email address associated with their account (that is, stored in the auth_user table and accessible by django.contrib.auth.models.User).

Django's site framework must be enabled, and Site.objects.get_current() must provide the issuers name and domain.

In your templates, you need to load django_obi_tags:

{% load django_obi_tags %}

Then use the send_badges_action inclusion-tag to add a 'Send' button and the neccesary javascript to interact with the Issuer API:

{% send_badges_action %}

Related Projects