@app.route("/search")
def search():
    if "username" in session:
        return render_template("search.html")
    return render_template("error.html", message="You are not logged in!")

@app.route("/logout")
def logout():
    session.pop('username', None)
    return redirect(url_for('index'))