-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.py
33 lines (23 loc) · 828 Bytes
/
server.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
from flask import Flask, request, render_template
from time import sleep
from JobSearcher import JobSearcher
app = Flask(__name__)
# app.secret_key = 'this-should-be-something-unguessable'
@app.route('/')
def index():
return render_template('index.html')
@app.route('/show_listings')
def retrieve_listings():
location = request.args.get('location')
print location
is_partner = request.args.get('is_partner')
print is_partner
title = request.args.get('title')
print title, type(title)
# If they enter nothing? I think this would be an empty string, not None
# Test to check
jobs = JobSearcher(location, is_partner, title)
listings = jobs.get_listings()
return render_template('listings.html', listings=listings)
if __name__ == "__main__":
app.run(debug=True)