heroku hosted flask app redirects to localhost
I don't have experience with flask, but docs say that you can pass _external=True
to url_for
method. This will generate absolute url and you can control actual host with SERVER_NAME
environment variable. So you should it set it up on heroku:
heroku config:set SERVER_NAME=your_host