Skip to content

Commit 22da3af

Browse files
committed
update
1 parent f0616b6 commit 22da3af

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

app.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
import os, uuid
22
import pandas as pd
33

4-
<<<<<<< HEAD
54
import pymssql
65
from azure.identity import DefaultAzureCredential
76
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
87
import datetime
9-
=======
10-
from azure.identity import DefaultAzureCredential
11-
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
12-
>>>>>>> 819196df4b034b220112190ae0cd93812ce6c659
138

149
from flask import (Flask, redirect, render_template, request,
1510
send_from_directory, url_for, session)
1611

1712
app = Flask(__name__)
1813
app.secret_key = os.urandom(24)
1914

20-
<<<<<<< HEAD
2115
conn = pymssql.connect(host='sinong.database.windows.net' ,user='sinong' ,password = 'Wang1997h',database='cse6332')
2216
cur = conn.cursor()
23-
=======
24-
>>>>>>> 819196df4b034b220112190ae0cd93812ce6c659
2517
#================================================================================================
2618
# # Create a blob client using the local simulator
2719
# try:
@@ -44,7 +36,6 @@ def index():
4436
return render_template('index.html')
4537

4638

47-
<<<<<<< HEAD
4839
@app.route('/test')
4940
def test():
5041
SQL_QUERY = """
@@ -67,8 +58,6 @@ def test():
6758
return render_template('test.html', data=data)
6859

6960

70-
=======
71-
>>>>>>> 819196df4b034b220112190ae0cd93812ce6c659
7261
@app.route('/assignment1')
7362
def assignment1():
7463
data_file_path = os.path.join(app.root_path, 'static', 'data', 'people.csv')
@@ -78,7 +67,6 @@ def assignment1():
7867
return render_template('assignment1.html', contain_content=False, table_content=list(data.values.tolist()), titles=data.columns.values)
7968

8069

81-
<<<<<<< HEAD
8270
@app.route('/assignment2')
8371
def assignment2():
8472

@@ -88,14 +76,11 @@ def assignment2():
8876
return render_template('assignment2.html', contain_content=False, table_content=data, titles=headers)
8977

9078

91-
=======
92-
>>>>>>> 819196df4b034b220112190ae0cd93812ce6c659
9379
@app.route('/a1-upload', methods = ['POST'])
9480
def upload():
9581
if request.method == 'POST':
9682
f = request.files['file']
9783
file_path = os.path.join(app.root_path, 'uploads', f.filename)
98-
<<<<<<< HEAD
9984
session['file_path'] = file_path
10085
f.save(file_path)
10186

@@ -114,18 +99,12 @@ def upload():
11499
cur.execute(sql_query)
115100

116101
conn.commit()
117-
=======
118-
f.save(file_path)
119-
120-
data = pd.read_csv(file_path)
121-
>>>>>>> 819196df4b034b220112190ae0cd93812ce6c659
122102
return render_template('assignment1.html', contain_content=False, table_content=list(data.values.tolist()), titles=data.columns.values)
123103

124104

125105
@app.route('/a1-searchbyname', methods = ['POST', 'GET'])
126106
def a1_searchbyname():
127107
name = request.form.get('queryName')
128-
<<<<<<< HEAD
129108
data_file_path = session.get('file_path')
130109
data = pd.read_csv(data_file_path)
131110
query_data = data.loc[data['name'] == name]
@@ -181,15 +160,6 @@ def a2_searchbymag():
181160
return render_template('assignment2.html', contain_content=True, table_content=data, titles=headers)
182161

183162

184-
=======
185-
data_file_path = os.path.join(app.root_path, 'static', 'data', 'people.csv')
186-
data = pd.read_csv(data_file_path)
187-
query_data = data.loc[data['Name'] == name]
188-
print(name, query_data)
189-
return render_template('assignment1.html', contain_content=True, table_content=list(query_data.values.tolist()), titles=query_data.columns.values)
190-
191-
192-
>>>>>>> 819196df4b034b220112190ae0cd93812ce6c659
193163
@app.route('/favicon.ico')
194164
def favicon():
195165
return send_from_directory(os.path.join(app.root_path, 'static'),

0 commit comments

Comments
 (0)