-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
68 lines (53 loc) · 2.19 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
57
58
59
60
61
62
63
64
65
66
67
68
from flask import Flask, render_template, request
from werkzeug.utils import secure_filename
from Resume_parser import extract_skills, compare_skills, send_email,smptConn, extract_education, extract_certificates
app = Flask(__name__)
@app.route('/')
def homepage():
return render_template('home.html')
@app.route('/apply_job')
def applyjob():
return render_template("apply_job.html")
@app.route('/aboutUs')
def aboutUs():
return render_template("aboutUs.html")
@app.route('/fill_form')
def fillform():
return render_template("form.html")
@app.route('/uploader', methods=['GET', 'POST'])
def upload_file():
if request.method == 'POST':
appliedJob = request.form['job'] # get selected job from the form
nameGiven = request.form['name'] # get name from the form
emailGiven = request.form['email'] # get email from the form
f = request.files['file'] # taking reume file from submitted form
f.save(secure_filename(f.filename))
name, email, skills = extract_skills(f.filename)
skills_matched = compare_skills(appliedJob, skills)
# education = extract_education(f.filename)
# certificate = extract_certificates(f.filename)
# print(education)
# print(certificate)
print(email)
print(skills)
print(skills_matched)
is_rejected = True
if len(skills_matched) >= 4:
print("he is eligible")
is_rejected = False
s = smptConn()
send_email(email, name, is_rejected, appliedJob,s)
return render_template('success.html', name=nameGiven, email=emailGiven, skills=skills_matched)
else:
is_rejected = True
print("Sorry, we can't process your candidature")
s = smptConn()
send_email(email, name, is_rejected, appliedJob,s)
return render_template('success.html', name=nameGiven, email=emailGiven, skills=skills_matched)
else:
return render_template('home.html')
@app.route('/home')
def homepage2():
return render_template('home.html')
if __name__ == '__main__':
app.run(debug=True)