def get_logout_url(self): logout_url = getattr(settings, 'LOGOUT_URL', 'logout') return reverse(logout_url) if logout_url else None