-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.py
57 lines (48 loc) · 1.76 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
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html', name="Satya Patel", keySkills = keySkills, education = education, work_exp = work_exp)
@app.route('/View')
def hello():
return 'Welcome to Home Page!'
## After clicking Submit
@app.route('/go', methods=['POST'])
def go():
if(request.method == 'POST'):
name = request.form['name']
email = request.form['email']
contact = request.form['contact']
profile = request.form['profile']
job = request.form['job']
work_exp_count = request.form['work_exp_count']
work_exp = []
for i in range(int(work_exp_count)):
a = request.form['workexp_'+str(i+1)].split("\n")
work_exp.append({
'company':a[0],
'duration': a[1],
'description': a[2]
})
education_count = request.form['education_count']
education = []
for i in range(int(education_count)):
a = request.form['education_' + str(i + 1)].split("\n")
education.append({
'school':a[0],
'degree':a[1],
'description':a[2]
})
skills_count = request.form['skills_count']
keySkills = []
for i in range(int(skills_count)):
a = request.form['skills_' + str(i + 1)]
keySkills.append(a)
return render_template('index.html', name=name, email=email, job=job, contact=contact, profile=profile, keySkills = keySkills, education = education, work_exp = work_exp)
## For Rendering Form
@app.route('/form')
def form():
return render_template('getform.html')
if __name__ == '__main__':
app.run()
app.debug(True)