Example #1
0
def home():
    # first check if a user session has been set
    if session:
        print(session)
        allProducts = Products.fetch_by_status_onsale()
        return render_template('home.html', allProducts=allProducts)
    else:
        # redirect the customer to the login page
        return redirect(url_for('customer_login'))