Initial
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
from flask import Flask, render_template
|
||||
|
||||
# Initialize Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
"""Home page - Hello World"""
|
||||
return render_template('home.html')
|
||||
|
||||
@app.route('/about')
|
||||
def about():
|
||||
"""About page"""
|
||||
return render_template('about.html')
|
||||
|
||||
@app.route('/test')
|
||||
def test():
|
||||
"""Test route - no template needed"""
|
||||
import sys
|
||||
return f"""
|
||||
<html>
|
||||
<head><title>Test Page</title></head>
|
||||
<body style="font-family: Arial; padding: 20px;">
|
||||
<h1>Flask App is Running!</h1>
|
||||
<ul>
|
||||
<li><strong>Python:</strong> {sys.version}</li>
|
||||
<li><strong>Flask:</strong> Working</li>
|
||||
<li><strong>Routes:</strong> {len(list(app.url_map.iter_rules()))}</li>
|
||||
</ul>
|
||||
<p><a href="/">Home</a> | <a href="/about">About</a></p>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Run locally on port 8080
|
||||
app.run(debug=True, host='0.0.0.0', port=8080)
|
||||
Reference in New Issue
Block a user