-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
94 lines (50 loc) · 2.03 KB
/
Copy pathapp.py
File metadata and controls
94 lines (50 loc) · 2.03 KB
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
91
92
93
94
import os
from main import ConnectFlask
from werkzeug import secure_filename
from flask import Flask, request, redirect, url_for, render_template
app = Flask(__name__)
UPLOAD_FOLDER = '/home/innovationchef/Desktop/resume-parser/data/flask/'
ALLOWED_EXTENSIONS = set(['docx'])
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS
# @app.route("/", methods=['GET', 'POST'])
# def main():
# if request.method == 'POST':
# file = request.files['file']
# if file and allowed_file(file.filename):
# filename = secure_filename(file.filename)
# file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
# return redirect(url_for('index', file=filename))
# return """
# <!doctype html>
# <title>Upload new File</title>
# <h1>Upload new File</h1>
# <form action="" method=post enctype=multipart/form-data>
# <p><input type=file name=file>
# <a href={{ url_for('index') }}> <input type=submit value=Upload> </a>
# </form>
# <p>%s</p>
# """ % "<br>".join(os.listdir(app.config['UPLOAD_FOLDER'],))
# @app.route("/index/<file>")
# def index(file):
# app.logger.info(file)
# Resume = ConnectFlask(file)
# print(Resume.parse())
# lnames = ['HTML', 'CSS', 'JS', 'GO', 'Python']
# return render_template('index.html', lnames=lnames, lemails=lnames, lphones=lnames, laddresses=lnames)
@app.route("/")
def main():
lnames = ['HTML', 'CSS', 'JS', 'GO', 'Python']
return render_template('index.html', lnames=lnames, lemails=lnames, lphones=lnames, laddresses=lnames)
if __name__ == "__main__":
app.debug = True
app.run()
# from flask import Flask, render_template, url_for
# app = Flask(__name__)
# @app.route("/")
# def main():
# return render_template('index.html')
# if __name__ == "__main__":
# app.debug = True
# app.run()