4. Authorization and registration

You can use any auth app for django but if you want a quick and easy setup with GoScale you’re in luck - we support django-allauth (only version 0.9 at the moment)! Which is one of the most convenient apps to handle all of your user account needs. We also added a few template tags and utils for it to make it easier to use.

4.1. Installation

Just follow the tutorial from django-allauth README. Here’s a brief summary:

Install django the requirements:

pip install django-allauth==0.9.0 django-avatar
./manage.py syncdb
./manage.py migrate



    # Needed to login by username in Django admin, regardless of `allauth`

    # `allauth` specific authentication methods, such as login by e-mail

    # ... include the providers you want to enable:


urlpatterns = patterns('',
    (r'^accounts/', include('allauth.urls')),
    (r'^goscale/', include('goscale.urls')),

Example settings (consult the docs for more customizaton):

    'google': {
        'SCOPE': [
        'AUTH_PARAMS': { 'access_type': 'online' }

Make sure to create social apps in the admin for all the providers you choose.

4.2. Usage

You can use it as is the way intended by django-allauth . Or you can use GoScale combined Sign In / Sign Up view:

{% load url from future %}
{% load i18n %}
{% load account %}

<a href="{% url 'goscale_account_signup' %}" rel="next">{% trans "Log in" %} / {% trans "Register" %}</a>

We also already have a template tag that handles the whole “User bar”:

{% load goscale_tags %}

{% goscale_user %}