from flask import Flask, render_template, request app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/about') def about(): return render_template('about.html') @app.route('/contact', methods=['GET', 'POST']) def contact(): if request.method == 'POST': # Process form data here name = request.form['name'] email = request.form['email'] message = request.form['message'] # For simplicity, we'll just print the form data to the console print(f"Name: {name}, Email: {email}, Message: {message}") return render_template('contact.html', success=True) return render_template('contact.html') @app.route('/blog') def blog(): # Sample blog posts posts = [ { 'title': 'Welcome to Streamwood Biking', 'content': 'Streamwood Biking is a community of passionate cyclists...', 'date': '2023-01-01' }, { 'title': 'Tips for Adjusting Your Bike Seat Height', 'content': 'Proper seat height is crucial for a comfortable ride...', 'date': '2023-01-02' } ] return render_template('blog.html', posts=posts) if __name__ == '__main__': app.run(debug=True)