I need to redirect back to an external url after completing an action in my flask application. The code looks like this
if form.next.data is not None:
return redirect(form.next.data)
where form.next.data
can be an absolute url for an external domain like "www.google.com". However on passing the next value as an external url, this redirect is instead redirecting to http://mysitename/www.google.com
and failing with a 404.
How do I specify that the redirect is to an external domain and stop Flask from appending it to my domain root?