Advertisement
fabilus11

Untitled

Jun 13th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.68 KB | None | 0 0
  1. import os
  2. import secrets
  3. from PIL import Image
  4. from flask import render_template, url_for, flash, redirect, request, abort
  5. from SpaceBlog import app, db, bcrypt, mail
  6. from SpaceBlog.forms import (RegistrationForm, LoginForm, UpdateAccountForm,
  7.                              PostForm, RequestResetForm, ResetPasswordForm)
  8. from SpaceBlog.models import User, Post
  9. from flask_login import login_user, current_user, logout_user, login_required
  10. from flask_mail import Message
  11. import mysql.connector as mariadb
  12.  
  13. @app.route('/')
  14. def index():
  15.     return render_template('index.html')
  16.  
  17. @app.route('/home')
  18. def home():
  19.     return render_template('index.html')
  20.  
  21. @app.route('/about')
  22. def about():
  23.     return render_template('about.html')
  24.  
  25. @app.route("/forum")
  26. def forum():
  27.     page = request.args.get('page', 1, type=int)
  28.     posts = Post.query.order_by(Post.date_posted.desc()).paginate(page=page, per_page=5)
  29.     return render_template('forum.html', posts=posts)
  30.  
  31. @app.route("/test")
  32. def test():
  33.     flash("Flash test!!!")
  34.     return render_template('space_layout.html')
  35.    
  36. @app.route('/contact')
  37. def contact():
  38.     return render_template('contact.html')
  39.  
  40. @app.route('/map')
  41. def map():
  42.     return render_template('map.html')
  43.  
  44. @app.route('/space')
  45. def space():
  46.     return render_template('space.html')
  47.  
  48. @app.route('/apollo_audio')
  49. def apollo_audio():
  50.     return render_template('space_sound.html')
  51.  
  52. @app.route('/space/audio/apollo11')
  53. def apollo11_audio():
  54.     return render_template('apollo11.html')
  55.    
  56. @app.route('/space/audio/apollo12')
  57. def apollo12Audio():
  58.     return render_template('apollo12.html')
  59.    
  60. @app.route('/space/audio/apollo13')
  61. def apollo13Audio():
  62.     return render_template('apollo13.html')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement