|
-
-
-
-
-
-
-
-
- from flask import Blueprint, render_template
- from flask_login import login_required, current_user
- from . import db
- from .models import Resource
- from sqlalchemy.sql import func
-
- main = Blueprint('main', __name__)
-
-
- @main.route('/')
- def index():
- tools = Resource.query.filter_by(type='tool').order_by(func.random()).limit(5).all()
- return render_template('index.html', tools=tools)
-
-
- @main.route('/profile')
- @login_required
- def profile():
- return render_template('profile.html', name=current_user.name)
-
-
- @main.route('/test')
- def test():
- return render_template('test.html')
|