Python Forum
Flask - Opening second page via href is failing - This site can’t be reached
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask - Opening second page via href is failing - This site can’t be reached
#1
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>
Reply
#2
Change your HOME doc to:
<a href="<http://10.235.244.92:97/second >">Open Second Page</a>
Reply
#3
Smile Tnx working
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Flask run function in background and auto refresh page raossabe 2 7,238 Aug-20-2022, 10:00 PM
Last Post: snippsat
  Extract Href URL and Text From List knight2000 2 8,616 Jul-08-2021, 12:53 PM
Last Post: knight2000
  BeautifulSoup pagination using href rhat398 1 2,349 Jun-30-2021, 10:55 AM
Last Post: snippsat
  Accessing a data-phone tag from an href KatMac 1 2,863 Apr-27-2021, 06:18 PM
Last Post: buran
  Reload flask current page GrahamL 2 5,049 Jan-08-2021, 08:31 AM
Last Post: GrahamL
  API auto-refresh on HTML page using Flask toc 2 11,743 Dec-23-2020, 02:00 PM
Last Post: toc
  [Flask]After login page is not redirecting me to dashboard shockwave 0 2,657 May-07-2020, 05:22 PM
Last Post: shockwave
  Flask - adding new page affects all other pages CMR 15 5,464 Mar-28-2020, 04:13 PM
Last Post: CMR
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 3,578 Mar-19-2020, 06:13 PM
Last Post: apollo
  How to get the href value of a specific word in the html code julio2000 2 3,143 Mar-05-2020, 07:50 PM
Last Post: julio2000

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020