DmitrMakeev commited on
Commit
9d02916
·
1 Parent(s): eeb73f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -2,9 +2,11 @@ import flask
2
  from flask import request, jsonify
3
  import os
4
  import json
 
5
  import pandas as pd
6
  from dotenv import load_dotenv
7
  load_dotenv()
 
8
 
9
  app = flask.Flask(__name__, template_folder="./")
10
 
@@ -23,10 +25,11 @@ def predict():
23
  def avp():
24
  incoming = request.get_json()
25
  print(incoming)
26
-
27
  # Изменение значений JSON-файла
28
  data = pd.DataFrame.from_dict(incoming, orient='index', columns=['value'])
29
  data['value'] -= 1
 
30
  data.loc[data['value'] < 0, 'value'] = 0
31
  response = data.to_dict()['value']
32
 
 
2
  from flask import request, jsonify
3
  import os
4
  import json
5
+ import logging
6
  import pandas as pd
7
  from dotenv import load_dotenv
8
  load_dotenv()
9
+ logging.basicConfig(level=logging.DEBUG, filename='debug.log', filemode='w')
10
 
11
  app = flask.Flask(__name__, template_folder="./")
12
 
 
25
  def avp():
26
  incoming = request.get_json()
27
  print(incoming)
28
+ logging.debug(f"Incoming data: {incoming}")
29
  # Изменение значений JSON-файла
30
  data = pd.DataFrame.from_dict(incoming, orient='index', columns=['value'])
31
  data['value'] -= 1
32
+ logging.debug(f"Incoming data: {incoming}")
33
  data.loc[data['value'] < 0, 'value'] = 0
34
  response = data.to_dict()['value']
35