def redirect(self, url):
        response = getattr(self.request, 'response', None)
        if response is None:
            response = HTTPFound(location=url)
        else:
            response = HTTPFound(location=url, headers=response.headers)
        return response
Mimic as_view and with forms to skip some of the context
dataset/ETHPy150Open omab/python-social-auth/social/strategies/pyramid_strategy.py/PyramidStrategy.redirect--crossover with--dataset/ETHPy150Open CenterForOpenScience/osf.io/admin_tests/utilities.py/setup_form_view