Python Forum

Full Version: Flask - Opening second page via href is failing - This site can’t be reached
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have small Python Flask application which is running over IIS Windows server, when trying to navigate to second page I'm getting the error:
"This site can’t be reached"

IIS FastCGI is bending the website to http://10.235.244.92:97/ which is working as the main page

The problem is with the href:
<a href="http://127.0.0.1:5000/second">Open Second Page</a>
I tried also to modify It to below but Its not working
<a href="http://10.235.244.92:97/second">Open Second Page</a>

Below is the code:

Main:
-----
from flask import Flask, render_template
app = Flask(__name__, static_url_path="/static")
@app.route('/')
def home():
return render_template('home.html')

@app.route('/second')
def home2():
return render_template('Second.html')


if __name__ == '__main__':
app.run()

home:
-----
<!DOCTYPE html>
<html>
<body>
<h1><u> Website</u></h1>
<p>Hi, welcome to the Site</p>
<a href="http://127.0.0.1:5000/second">Open Second Page</a>
<p> </p>
<img src="/static/smiley.gif" width="50" height="50" align ="bottom" align="center">

</body>
</html>
Change your HOME doc to:
<a href="<http://10.235.244.92:97/second >">Open Second Page</a>
Smile Tnx working