neww
from flask import Flask, render_template_string
app = Flask(__name__)
# Home page
@app.route("/")
def home():
return render_template_string("""
<html>
<head>
<title>My Network Website</title>
</head>
<body style="font-family: Arial; text-align: center; margin-top: 50px;">
<h1>🌍 Welcome to My Network Website</h1>
<p>This site is open for free access.</p>
<a href="/about">About</a>
</body>
</html>
""")
# About page
@app.route("/about")
def about():
return "<h2>About Page</h2><p>This is a simple Python website accessible on the network.</p>"
if __name__ == "__main__":
# host=0.0.0.0 → makes the server visible to others on your network
app.run(host="0.0.0.0", port=5000, debug=True)
Comments
Post a Comment