-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflask-app.py
90 lines (71 loc) · 2.58 KB
/
flask-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from flask import Flask, render_template, request, flash, redirect, url_for
import sqlite3
app = Flask(__name__)
def db(sqlQuiry): #sqlQuiry
db = sqlite3.connect("database/flask.db")
cur = sqlite3.Cursor(db)
result = cur.execute(sqlQuiry)
#username= "test"
#email = "[email protected]"
#password= "sdafdsf"
#result = cur.execute(f"insert into users(userName, emailAddress, password) values('{username}','{email}','{password}')")
db.commit()
return result
#db()
@app.route("/")
def index():
return render_template("index.html")
@app.route("/portfolio")
def portfolio():
return render_template("portfolio.html")
@app.route("/login", methods=["GET","POST"])
def login():
Username = ""
Password = ""
#quiry0 = db(f"select password from users where username = '{Username}'")
if request.method == 'POST':
Username = request.form['Username']
Password = request.form['Password']
return redirect(url_for("portfolio"))
return render_template("login.html", Username = Username, Password = Password)
@app.route("/signUp", methods=["GET","POST"])
def signUp():
if request.method == "POST":
username = request.form["Username"]
email = request.form["EmailAddress"]
password = request.form["Password"]
db(f"insert into users(userName, emailAddress, password) values('{username}','{email}','{password}')")
return redirect(url_for("login"))
return render_template("signUp.html")
@app.route("/forgotPassword", methods=["GET","POST"])
def forgotPassword():
if request.method == "POST":
email = request.form["emailAddress"]
updatedPassword = request.form["password"]
db(f"update users set password = '{updatedPassword}' where emailAddress='{email}';")
return render_template("forgotPassword.html")
@app.route("/investments")
def investments():
return render_template("Investments.html")
@app.route("/aboutUs")
def aboutUs():
return render_template("aboutUs.html")
@app.route("/RE_Vs_CRE")
def RE_Vs_CRE():
return render_template("RE_Vs_CRE.html")
@app.route("/property")
def property():
return render_template("Property.html")
@app.route("/REITs_Vs_Frational")
def REITs_Vs_Frational():
return render_template("REITS_Vs_Fractional_Ownership.html")
@app.route("/research&insights")
def researchInsights():
return render_template("Research_&_Insights.html")
@app.route("/registra")
def creatAccount():
return render_template("Research_&_Insights.html")
#Test HelloWorld
@app.route("/helloWorld1")
def hello_world():
return "<p>Hello, World!</p>"