-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
56 lines (49 loc) · 1.7 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
47
48
49
50
51
52
53
54
55
56
#employees
from requests import session
from employees.datahandlers.employee_datahandlers import employee_datahandlers
from employees.employee_routes import employee_routes
from employees.employee_login_and_signup import employee_login_and_signup
#employers
from employers.datahandlers.employer_datahandlers import employer_datahandlers
from employers.employer_signup_and_login import employer_signup_and_login
from employers.employer_routes import employer_routes
#jobs
from jobs.datahandlers.job_datahandlers import job_datahandlers
from jobs.job_routes import job_routes
#global imports
from quart import Quart, render_template, session
from quart_session import Session
import motor
from CONFIG import *
client = CLIENT
db = client.main
app = Quart(__name__)
#employees
app.register_blueprint(employee_routes)
app.register_blueprint(employee_datahandlers)
app.register_blueprint(employee_login_and_signup)
#employers
app.register_blueprint(employer_datahandlers)
app.register_blueprint(employer_signup_and_login)
app.register_blueprint(employer_routes)
#jobs
app.register_blueprint(job_datahandlers)
app.register_blueprint(job_routes)
#configs
sess = Session(app)
app.config["TEMPLATES_AUTO_RELOAD"] = True
#routes
@app.route("/", methods=['GET'])
async def index():
return await render_template('index.html')
@app.route("/getstarted", methods=['GET'])
async def getstarted():
return await render_template('getstarted.html')
# If the file is run directly,start the app.
if __name__ == '__main__':
app.config['SESSION_TYPE'] = 'redis'
app.config['SESSION_URI'] = 'redis://:@localhost:5001'
app.secret_key = 'supersecretkey'
app.config["SESSION_PERMANENT"] = False
sess.init_app(app)
app.run(debug=True)