Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
d140f2b
1
Parent(s):
cdb7807
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,11 @@ import os
|
|
5 |
import uuid
|
6 |
import shutil
|
7 |
|
|
|
|
|
|
|
|
|
|
|
8 |
app = Flask(__name__, template_folder="./")
|
9 |
|
10 |
app.config['DEBUG'] = True
|
@@ -19,6 +24,25 @@ if not os.path.exists(UPLOAD_FOLDER):
|
|
19 |
if not os.path.exists(HTML_FOLDER):
|
20 |
os.makedirs(HTML_FOLDER)
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
@app.route('/upload', methods=['POST'])
|
23 |
def upload_file():
|
24 |
if 'file' not in request.files:
|
|
|
5 |
import uuid
|
6 |
import shutil
|
7 |
|
8 |
+
|
9 |
+
from datetime import datetime
|
10 |
+
import pytz
|
11 |
+
|
12 |
+
|
13 |
app = Flask(__name__, template_folder="./")
|
14 |
|
15 |
app.config['DEBUG'] = True
|
|
|
24 |
if not os.path.exists(HTML_FOLDER):
|
25 |
os.makedirs(HTML_FOLDER)
|
26 |
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
@app.route('/get_current_time', methods=['GET'])
|
31 |
+
def get_current_time():
|
32 |
+
utc_now = datetime.utcnow()
|
33 |
+
msk_tz = pytz.timezone('Europe/Moscow')
|
34 |
+
msk_now = utc_now.replace(tzinfo=pytz.utc).astimezone(msk_tz)
|
35 |
+
current_time = msk_now.strftime('%Y-%m-%d %H:%M:%S')
|
36 |
+
return jsonify({'current_time': current_time})
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
@app.route('/upload', methods=['POST'])
|
47 |
def upload_file():
|
48 |
if 'file' not in request.files:
|