routes.py 506 B

1234567891011121314151617181920
  1. from flask import render_template
  2. from app import app
  3. @app.route('/')
  4. @app.route('/index')
  5. def index():
  6. user = {'username': "Pusheen"}
  7. posts = [
  8. {"author": {"username": "Stormy"},
  9. "body":"Meowingful day, isn't it ? "
  10. },
  11. {"author": {"username": "Thomos"},
  12. "body": "bla bla bla "
  13. }
  14. ]
  15. return render_template('index.html',
  16. title="home",
  17. user=user,
  18. posts=posts)