Django redirect from resource not working

I have this in my resource:

def after_import_instance(self, instance, new, row_number=None, **kwargs):
    ...
    base_url = 'https://account.box.com/api/oauth2/authorize'
    client_id = '[CLIENT_ID]'
    auth_url = f'{base_url}?client_id={client_id}&response_type=code'
            
    print(auth_url)
    return redirect(auth_url)

the auth_url is being printed, but the redirect is not working. Here is the print:

[2022-09-01 05:07:10,617: WARNING/MainProcess] https://account.box.com/api/oauth2/authorize?client_id=[CLIENT_ID]&response_type=code
Back to Top