heroku hosted flask app redirects to localhost heroku hosted flask app redirects to localhost flask flask

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


Well, according to the help page, Heroku doesn't redirect. So any redirects are performed by your app.