-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
35 lines (22 loc) · 897 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from flask import Flask , render_template , request
from model import get_recommendations ,cosine_sim2 ,df2
app = Flask(__name__)
@app.route("/")
def home():
return render_template("home.html" , movie_title = df2["title"])
@app.route('/recommendations', methods=['POST'])
def recommendations():
# Get the movie title entered by the user
title = request.form['title']
# Get the recommendations using the get_recommendations function
recommended_movies = get_recommendations(title, cosine_sim2)
# Pass the recommendations to the template for displaying
return render_template('recommendations.html', title=title, recommendations=recommended_movies)
@app.route("/about")
def about():
return render_template("about.html")
@app.route("/connect")
def connect():
return render_template("connect.html")
if __name__ == "__main__":
app.run(debug=True)