From c2a3865b791c508412a7aaa17ad694a2a15e9292 Mon Sep 17 00:00:00 2001 From: Aditya Jee Date: Tue, 23 Feb 2021 14:48:23 +0530 Subject: [PATCH 1/8] Deployment Commit --- Procfile | 2 ++ app.py | 2 +- requirements.txt | Bin 0 -> 2252 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Procfile create mode 100644 requirements.txt diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..9f97db9 --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +web: gunicorn app:app +heroku ps:scale web=1 \ No newline at end of file diff --git a/app.py b/app.py index 56d15b9..45476e0 100644 --- a/app.py +++ b/app.py @@ -214,7 +214,7 @@ def updateThread(): print("Update Thread Called") print(threading.current_thread().name) # schedule.every(1).minutes.do(checkFunction) - schedule.every(1).hours.do(checkFunction) + schedule.every(6).hours.do(checkFunction) while True: # print("While loop of updateThread") schedule.run_pending() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..c8ee9b1cef1c4b049ea149b3c71f6cd613cc0d07 GIT binary patch literal 2252 zcmZ{mOK%fF5QOK9#7{AbH*pAu91tQ01X2)45l24~XA^s!tnIvhJWyZPj%Uq7)+*L^ zPj_`y^*FzNj?v-)zjx|FKYG2>a~Sm|iu(P5-ti3M{Zv)ju14MAI7n4w94m`& z;F+dtb!&z7QrXl$?CKnK@r7_q({04wMtx5E>`LfXIz3KHJ)8zXVPmRjqbce%7k>Jz z0~eW0+{a6m=g2p&xl+ct)>%$3^h`UfaL?nM4?4fmJoL<1s^F^XSV1@RVW!D0#}hLV zNU6_MdFIT=u$%f!QB*b~8G#v@OQ%LPn7i#zm~&4Vo9M&T+%aZS^4iF1bC zY~ZG*HG(@-v_`ewu61s#lk?ygzZ7>ChCZo&lWvq*#q{n#-1u+QW75NAeNf#DGx>{H z9z@;;GKGSzz$vLJ@XRbt=-40UsSCXk9hl=zF(_t|U z8uodk%9~CLlp2LI8`WH@YQZz?d_Z4sU!$rInuM&rYwTWo^QdDO?>52kKC7OvINMW# z9fanLD9+ti8&0j>xinemvr3OK-$|Uz^MMXGv7b2iS()Ym?fPAapspRVA3fK(uZoPK z1MV5d{#o@B9jHewMyvugKx3wJ)`j{{(#P-`{fy?%n&939W^ephQy3YZLaF0W%6Z<| zK`_iI-+pFuABFQ@0wJ5_?J5X=r1$dG=iQvB>1eCEY{%1IXYF!3hpc<`H``Vl1XXy~ zimo-wwK8VP%W9xGbxKApSF)Ld$ieCTTL}itKGop7coi<~tp0t+_7@KsbJ0I%a{J(Y z6r{&cxQz|xqps)oe!)&geEScaIp*IVPG4$givNs)%Kz7zPM(G>gWs{3yOXE+^}rQH z=Yo{q$b4(KOTX8>DtJaF7zOiYa~mv~r^8@@npLnhlyu7c!a9dqi*cjN9==f49mZ i!~A4NKPt}uBi<`w{6^*IMf#r3#9}K<#m6AA8ovQ(dOOen literal 0 HcmV?d00001 From 4e4c18a11dd90dc768dc8ab6544b663634678a44 Mon Sep 17 00:00:00 2001 From: Aditya Jee Date: Tue, 23 Feb 2021 15:00:12 +0530 Subject: [PATCH 2/8] Deployment Commit --- requirements.txt | Bin 2252 -> 1712 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/requirements.txt b/requirements.txt index c8ee9b1cef1c4b049ea149b3c71f6cd613cc0d07..43a7fc0d365cbfbee50a27dbf428a8f3782a987b 100644 GIT binary patch delta 35 tcmV+;0Nnq~5wH!gVgi%E0@9Nf1fr8t1>BQb27;6L1|*X}2h@{D2!sW44k`cu delta 524 zcmZuuyH3ME5F90h0x3lrx)c-?6i#A0j-a5VCl#WgaIgg@C+8?Rkf`znRQC~S^C2`; z6shtj%&r~r)X6@}Gdnx8yJ^35Hj~D!K?aKympl=A2r)n#M=)5T!~#x{gvf}`u*MwG zj8zs7$jK`4#6O}Dszwh3f7kd}Sxl)=C=wG%wBC|E!yGT)DlUjdik3ujD&ON7fwCMP z*}*D%s4l3lcjafUPQ=eo53%nz*Q;yx8Pi3g^^zpy_rBW~8nD{1UzI{;ajsmM#-4RU zXA@j$Zo_x}ucjn(#FjkyF~^fKOf^WcErS^O_vY@TU_-}{Q<78is))jglok2)!E2}Z pjr+4!zgx@yQI`e8e%#ugX2cAKC<_WWa9LMcFHAy;kJxt){U- Date: Tue, 23 Feb 2021 15:17:04 +0530 Subject: [PATCH 3/8] Deployment Commit --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 45476e0..6f645f6 100644 --- a/app.py +++ b/app.py @@ -18,7 +18,7 @@ def get_db_connection(): return conn -app = Flask(__name__) +app = Flask(__name__, template_folder='templates/') @app.route('/') From 837edfd8864dd779347c8b4836da108c9949e8ff Mon Sep 17 00:00:00 2001 From: Aditya Jee Date: Tue, 23 Feb 2021 15:24:37 +0530 Subject: [PATCH 4/8] Deployment Commit --- Procfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Procfile b/Procfile index 9f97db9..8001d1a 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1 @@ -web: gunicorn app:app -heroku ps:scale web=1 \ No newline at end of file +web: gunicorn app:app \ No newline at end of file From f713424c40f56ee79e66836c9b1f04f928b423f8 Mon Sep 17 00:00:00 2001 From: Aditya Jee Date: Tue, 23 Feb 2021 15:41:43 +0530 Subject: [PATCH 5/8] Deployment-2 --- app.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 6f645f6..fbdbae7 100644 --- a/app.py +++ b/app.py @@ -18,7 +18,8 @@ def get_db_connection(): return conn -app = Flask(__name__, template_folder='templates/') +app = Flask(__name__, template_folder='Templates') +# app.config['EXPLAIN_TEMPLATE_LOADING'] = True @app.route('/') @@ -233,11 +234,22 @@ def update(): return redirect(url_for("dashboard")) -if __name__ == "__main__": +@app.before_first_request +def thread_start(): threading.Thread(target=updateThread).start() app.secret_key = 'secret123' # For Production/Deployment - app.run() - # For Development - # app.run(debug=True) +if __name__ == '__main__': + app.secret_key = 'secret123' + app.run(debug=True, threaded=True, use_reloader=False) + + +# if __name__ == "__main__": +# threading.Thread(target=updateThread).start() +# app.secret_key = 'secret123' + +# # For Production/Deployment +# app.run() +# # For Development +# # app.run(debug=True) From f1343477b0512a0aa1f11544cb925bca55ba03a8 Mon Sep 17 00:00:00 2001 From: Aditya Jee Date: Tue, 23 Feb 2021 19:05:41 +0530 Subject: [PATCH 6/8] Deployment-3 --- app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app.py b/app.py index fbdbae7..bb92b97 100644 --- a/app.py +++ b/app.py @@ -237,7 +237,6 @@ def update(): @app.before_first_request def thread_start(): threading.Thread(target=updateThread).start() - app.secret_key = 'secret123' # For Production/Deployment if __name__ == '__main__': From a1972d3db6b7cb8047c16e9d2d463b292e68a735 Mon Sep 17 00:00:00 2001 From: Aditya Jee Date: Tue, 23 Feb 2021 19:16:41 +0530 Subject: [PATCH 7/8] Deployment-4 --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index bb92b97..ca8dc0b 100644 --- a/app.py +++ b/app.py @@ -19,6 +19,7 @@ def get_db_connection(): app = Flask(__name__, template_folder='Templates') +app.config['SECRET_KEY'] = 'secret123' # app.config['EXPLAIN_TEMPLATE_LOADING'] = True @@ -240,7 +241,6 @@ def thread_start(): # For Production/Deployment if __name__ == '__main__': - app.secret_key = 'secret123' app.run(debug=True, threaded=True, use_reloader=False) From ad8777ce237abded9e353dc4bc1f7f7dc30fc851 Mon Sep 17 00:00:00 2001 From: Aditya Jee Date: Tue, 23 Feb 2021 20:04:49 +0530 Subject: [PATCH 8/8] Deployment-5 --- app.py | 20 ++++++++++---------- database.db | Bin 24576 -> 24576 bytes init_db.py | 17 ++++++++--------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app.py b/app.py index ca8dc0b..c731906 100644 --- a/app.py +++ b/app.py @@ -10,6 +10,7 @@ import schedule import time import threading +from init_db import initializeDB def get_db_connection(): @@ -183,6 +184,15 @@ def add_url(): return redirect(url_for('dashboard')) +# Unique Endpoint protected By Secret ID to clear the database completely +@app.route('/clearAll/', methods=['GET']) +def clearDatabase(id): + print([id]) + if [id] == ['secret@key@to@delete@database@entries']: + initializeDB() + return redirect(url_for('register')) + + def checkFunction(): # get db conn print("checkFunction Called") @@ -242,13 +252,3 @@ def thread_start(): # For Production/Deployment if __name__ == '__main__': app.run(debug=True, threaded=True, use_reloader=False) - - -# if __name__ == "__main__": -# threading.Thread(target=updateThread).start() -# app.secret_key = 'secret123' - -# # For Production/Deployment -# app.run() -# # For Development -# # app.run(debug=True) diff --git a/database.db b/database.db index 5f8b0259a87b95c83e86a70beaf0bc692ad91eee..e910e4634442889fc2451a66e3e7901a6873e72a 100644 GIT binary patch delta 487 zcmZoTz}Rqrae}m9I0FL%8xX^Q$V44u#_){^emsogo7eLMF*1rx*5y;;G%77lEh=W! z6b15DGKx&T&Uc&9c=BfcKqdx(&4LE!`6o`$X5#{x0_XDZg1HO~{IB_6L(~MY8t{K( z;AR9H#sZWUWz5OU%PtlIGPyXxq7XAcIvJROmH z3J9wdd=rbZfo7%U7b%1nWtIS~)KPFLN-T#k^7B)Gfs(F}n3tk}a1>+yWW#7{&4MZq vpS=8HCm+4|;0RMQ%Xq!4f^=ph10zFS10!7{V+BJKD?=Jp>p&xrrOE>!uuFdiGBDz8G1rzS>i3x~`6bii+pTO|{zatr<;HHr0x%u@bv&v|H=uV@Z^F zo@YymRJJi6GZVOD&6k@iY;MyK3LoBpV}FLtaX&aHJ4Te`3-3;d7=b0YTQAb|;s zQkQ{5AdVaJkay?K)fg&sIln?=)No~Cry3V`^^LrR8*IL_scAW1-T$l{k#iv{S<}*m zSiYFgSaP-$FKwjq#rBh=A4@{;oJa@_6%qqsKIA0sQ|K6=-{=cECN>_T!VEPF$0F7K zbB?-AN&k8m1hn0tIQlZZ8~p(`bPCWZ`bDlDAfATQ6g-