q = '%' + q + '%'
sql = (
    "SELECT * from auth_user WHERE lower(first_name) || ' ' || lower(last_name) = %s"
    )
User.objects.raw(sql, [q])
Using "like" in a cursor/query with a parameter in python (django)