-
Notifications
You must be signed in to change notification settings - Fork 24
/
app.py
46 lines (30 loc) · 1.25 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
from flask import Flask, request, jsonify, render_template
from predict import predict
app = Flask(__name__)
###############################################################################
# SETTING UP APP ROUTES #
###############################################################################
@app.route("/")
def index():
return render_template("index.html")
@app.route("/response", methods=["GET", "POST"])
def response():
if request.method == "POST":
snippet = request.form["fsnippet"]
# Testing with predict.py
personality_type = predict(snippet)
return render_template("response.html", name=personality_type, string=snippet)
@app.route("/analysis")
def analysis():
return render_template("analysis.html")
@app.route("/methodology")
def methodology():
return render_template("methodology.html")
@app.route("/about")
def about():
return render_template("about.html")
###############################################################################
# MAIN #
###############################################################################
if __name__ == "__main__":
app.run(debug=True)