I think you set this r'^logout/' url because you have to set it in settings. But do we have to set it here? Maybe there is another log out.