@@ -11,13 +11,15 @@ from flask import Blueprint, render_template | |||
from flask_login import login_required, current_user | |||
from . import db | |||
from .models import Tool | |||
from sqlalchemy.sql import func | |||
from sqlalchemy.orm import load_only | |||
main = Blueprint('main', __name__) | |||
# route for index page | |||
@main.route('/') | |||
def index(): | |||
tools = Tool.query.limit(3) | |||
tools = Tool.query.order_by(func.random()).limit(5).all() | |||
return render_template('index.html', tools=tools) | |||
# route for profile page |