Added support for custom user objects

It backwards compatible with Django 1.4 as well