extra = {'is_exact': "%s.first LIKE '%s'" % (User._meta.db_table, token)}
User.objects.filter(Q(first__istartswith=token)).extra(select=extra).order_by(
    '-is_exact', 'last')
Return exact matches at top of Django Queryset