-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
executable file
·42 lines (24 loc) · 768 Bytes
/
Copy pathapp.py
File metadata and controls
executable file
·42 lines (24 loc) · 768 Bytes
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
import os
import shutil
from main import main_api
from flask import Flask
cwd = os.getcwd()
FILES_FOLDER = os.path.join(cwd, 'files')
if os.path.exists(FILES_FOLDER):
shutil.rmtree(FILES_FOLDER)
os.mkdir(FILES_FOLDER)
else:
os.mkdir(FILES_FOLDER)
# Primary key column index of the first file
PRIMARY_INDEX_FIRST = 0
# Primary key column index of the second file
PRIMARY_INDEX_SECOND = 0
app = Flask(__name__)
app.secret_key = "secret key"
app.config['FILES_FOLDER'] = FILES_FOLDER
app.config['PRIMARY_KEY_FIRST'] = PRIMARY_INDEX_FIRST
app.config['PRIMARY_KEY_SECOND'] = PRIMARY_INDEX_SECOND
app.config['MAX_CONTENT_LENGTH'] = 50 * 1024 * 1024
app.register_blueprint(main_api)
if __name__ == "__main__":
app.run(debug=True, port=5000)