site.py 469 B

12345678910111213141516171819
  1. from app import app
  2. from flask import render_template
  3. @app.route('/')
  4. def home():
  5. """Render website's home page."""
  6. return render_template('home.html')
  7. @app.route('/about/')
  8. def about():
  9. """Render the website's about page."""
  10. return render_template('about.html')
  11. @app.route('/<file_name>.txt')
  12. def send_text_file(file_name):
  13. """Send your static text file."""
  14. file_dot_text = file_name + '.txt'
  15. return app.send_static_file(file_dot_text)