routes.py 666 B

123456789101112131415161718192021222324
  1. from flask import render_template
  2. from app import app
  3. @app.route('/')
  4. @app.route('/index')
  5. def index():
  6. user = {'username': 'Dm'}
  7. posts = [
  8. {
  9. 'author': {'username': 'John'},
  10. 'body': 'Beauriful day in Portland!'
  11. },
  12. {
  13. 'author': {'username': 'Susan'},
  14. 'body': 'The Avengers movie was so cool!'
  15. },
  16. {
  17. 'author': {'username': 'Ипполит'},
  18. 'body': 'Какая гадость эта ваша заливная рыба!!!'
  19. }
  20. ]
  21. return render_template('index.html', title='Home', user=user, posts=posts)