How to correctly set SERVER_NAME for a web application?

Viewed 89

For educational purposes, I am developing a web application, at the moment I am trying to implement a password reset function through a link sent to email. I'm generating a link using url_for and ran into a problem that it creates a link by inserting 'localhost' instead of the github server on which I'm running the application. Of the proposed solutions to this problem, there was only an indication of SERVER_NAME

app.config["SERVER_NAME"] = 'test.test'

but unfortunately, something went wrong, the application now does not start at all and an error appeared:

/usr/local/lib/python3.10/site-packages/flask/app.py:1781: UserWarning: Current server name 'localhost' doesn't match configured server name 'test.test'
  return self.url_map.bind_to_environ(
INFO: 127.0.0.1 - - [16/May/2022 17:50:21] "GET / HTTP/1.0" 404 -
0 Answers
Related