aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2021-11-17 15:26:06 -0500
committerPriyansh <[email protected]>2021-11-17 15:26:06 -0500
commit7170e823a8a9123736b112b03e929b168f79d194 (patch)
tree3538af61bd87d8e0d8a5ccbfe864e828b7f1f9e4
parenta74cdf64c155303c351d766a41b8a803979ce16a (diff)
downloadtemp_pred_arima-7170e823a8a9123736b112b03e929b168f79d194.tar.xz
temp_pred_arima-7170e823a8a9123736b112b03e929b168f79d194.zip
Heroku has no Support for SQLite: Reverting
-rw-r--r--Procfile1
-rw-r--r--__pycache__/app.cpython-38.pycbin231 -> 0 bytes
-rw-r--r--app.py35
-rw-r--r--app/__pycache__/main.cpython-38.pycbin1437 -> 0 bytes
-rw-r--r--requirements.txt1
-rw-r--r--wsgi.py4
6 files changed, 35 insertions, 6 deletions
diff --git a/Procfile b/Procfile
deleted file mode 100644
index fc272ab..0000000
--- a/Procfile
+++ /dev/null
@@ -1 +0,0 @@
-web: gunicorn wsgi:app \ No newline at end of file
diff --git a/__pycache__/app.cpython-38.pyc b/__pycache__/app.cpython-38.pyc
deleted file mode 100644
index 0899514..0000000
--- a/__pycache__/app.cpython-38.pyc
+++ /dev/null
Binary files differ
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..c443e68
--- /dev/null
+++ b/app.py
@@ -0,0 +1,35 @@
+from flask import Flask, render_template
+from flask import Markup
+import sqlite3 as sql
+import pandas as pd
+
+app = Flask(__name__)
+
+
+def execute_sql_statement(sql_statement, conn):
+ cur = conn.cursor()
+ cur.execute(sql_statement)
+ rows = cur.fetchall()
+ return rows
+
+def get_list_of_dict(keys, list_of_tuples):
+ list_of_dict = [dict(zip(keys, values)) for values in list_of_tuples]
+ return list_of_dict
+
+def get_cities_list():
+ conn = sql.connect("database.db")
+ sql_statement = 'SELECT DISTINCT(City_Name) as City_Name, Lat, Long FROM City_table join Loc_Table on City_Table.City_Id = Loc_table.City_Id'
+ df=pd.read_sql_query(sql_statement, conn).to_records(index=False)
+ return df
+
+def index():
+
+ cities_list = get_cities_list()
+ keys = ("city", "latitude", "longitude")
+ cities_list = get_list_of_dict(keys, cities_list)
+ return render_template("index.html", cities_list=cities_list)
+
+if __name__ == '__main__':
+ app.run(debug=True)
diff --git a/app/__pycache__/main.cpython-38.pyc b/app/__pycache__/main.cpython-38.pyc
deleted file mode 100644
index 478e41c..0000000
--- a/app/__pycache__/main.cpython-38.pyc
+++ /dev/null
Binary files differ
diff --git a/requirements.txt b/requirements.txt
index bb022de..dd9f47b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,2 @@
flask
pandas
-gunicorn
diff --git a/wsgi.py b/wsgi.py
deleted file mode 100644
index 2e6a19f..0000000
--- a/wsgi.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from app.main import app
-
-if __name__ == '__main__':
- app.run(debug=True)