Commit
•
79227de
1
Parent(s):
73985c4
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ from flask_cors import cross_origin, CORS
|
|
6 |
|
7 |
app = Flask(__name__)
|
8 |
CORS(app)
|
9 |
-
db = DBOperations()
|
10 |
|
11 |
|
12 |
@app.route("/")
|
@@ -14,6 +13,7 @@ db = DBOperations()
|
|
14 |
def update_news():
|
15 |
status = "success"
|
16 |
try:
|
|
|
17 |
news_df = get_news()
|
18 |
news_json = [*json.loads(news_df.reset_index(drop=True).to_json(orient="index")).values()]
|
19 |
db.insert_news_into_db(news_json)
|
|
|
6 |
|
7 |
app = Flask(__name__)
|
8 |
CORS(app)
|
|
|
9 |
|
10 |
|
11 |
@app.route("/")
|
|
|
13 |
def update_news():
|
14 |
status = "success"
|
15 |
try:
|
16 |
+
db = DBOperations()
|
17 |
news_df = get_news()
|
18 |
news_json = [*json.loads(news_df.reset_index(drop=True).to_json(orient="index")).values()]
|
19 |
db.insert_news_into_db(news_json)
|