diff --git a/Introduction to Computer Science/Website/Flask/register/__pycache__/app.cpython-38.pyc b/Introduction to Computer Science/Website/Flask/register/__pycache__/app.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a28ad35a9493a1bcd96b3b272169a34038ed0499 GIT binary patch literal 1014 zcmWIL<>g{vU|?vDejay&iGkrUh=Yt-7#J8F7#J9eV;C41QW#Pga~N_NqZo6UqL^}- zqnLA9qF5L~;!HWLxolBvj0~xasqD>+Q5>lp3pi7l7c!=>q_DOyG&4qVrE+9(rm&^3 zr*Nb*rEvB#rEsNigJrl=c!C);d0&F;)nvKF>XwsOoPCSGC^au7wJ5$MHMbxqu_W~t zdr@j(X=-uFEsmnpl+2>kV zYZ+=77BHqTEo7`^EMZDvu3=1J>17IL&}8-dB~o0NlUb5#rLV7_lbT#oT9m4nl2j!b z?CRs{9HOA5;1=ZXt5B4ho>^Q{l$cjiT*Z}{my%kcmr;_Nqse%Sr6|9=Sd+Pkje&vT z7JF(%YI12wY7sL71A`{hEvA&DB2ESdhLsFOJPZsBzcO8|Vq8;7lM_oa^Ydc-^Kvrt zQWc!@a|=Lv6oNBT^O92)Qc}~4Qd46*^Gb^HQ%aLTN)<}-k(4Ea)y0ITCKYFvq{e{5 zEC%Aj)S{Tgf&#sQ%3G{pSF(e`0pv6WCJsg}#v(oj28Jq5eVF1~%a~J1Sn86If_8(B*T#0zpM2h8=L04^2-B}XPMMh+$pMjl2UMixdU1||lk|7=V};tUK7ewsYD zSkpi$y$F7U}R))P*7lCU|?ooU|?cE07eD|1{MUD0mMh*Vr4Qj z=$R<+GB7YO@>eqOS7KE&DmWSfqaiRF0;3@?8UmvsFd71*Aut*OqaiRF0;3@?8Un*N z1R7Zw*~OKW85{je5|eULi&E1wi%W_U^Gb@5m`u(=u8twD3L%b8KCTK%NHR(a8eB@5 zDM|{Sej%>zu0aX`L7u*jL6HjHu8}%iN_mO7sY(iAjzP{IjzJnmrly)YTuQ0AiJ3X5 zqMD$-ITQbJ2L31f$A@oVkNRvh1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E1V zMF>bUu`mdmCgmqNC6?xmsfjt6$*B&h6^VHT IIjJBy05fSrj{pDw literal 0 HcmV?d00001 diff --git a/Introduction to Computer Science/Website/Flask/register/templates/index.html b/Introduction to Computer Science/Website/Flask/register/templates/index.html new file mode 100644 index 0000000..c9d1d2b --- /dev/null +++ b/Introduction to Computer Science/Website/Flask/register/templates/index.html @@ -0,0 +1,18 @@ + + + + + + Registrants + + +

Registrants

+
    + {% for row in rows %} +
  • {{ row["name"] }} , {{ row["email"] }}
  • + {% endfor %} +
+ + Register + + diff --git a/Introduction to Computer Science/Website/Flask/register/templates/register.html b/Introduction to Computer Science/Website/Flask/register/templates/register.html new file mode 100644 index 0000000..ed92e5a --- /dev/null +++ b/Introduction to Computer Science/Website/Flask/register/templates/register.html @@ -0,0 +1,15 @@ + + + + + + Document + + +
+ + + +
+ + diff --git a/Introduction to Computer Science/Website/Flask/tasks/__pycache__/app.cpython-38.pyc b/Introduction to Computer Science/Website/Flask/tasks/__pycache__/app.cpython-38.pyc index 0d4f877d65db764463ba9b673fb6c67063b4cc5a..a0377b8a9634730d8058b7c16ef2890408926b15 100644 GIT binary patch delta 699 zcmeyydV`%Wl$V!_fq{WxVes>~gG>|oWEdMJYD?DVvPQAyvPH2mGNdr1Fy*l4azt@3 zGNdx5ayBzYaiuV)a%FL+u-Gu9u!31^HVmm8sa(yBj0~w<3wTo47c!=Bq;R${G&4r= zrgCNRq;REhr|_gRrSSGLrSPTjgJt+q1cDhf1z&>f*JQiJ>XwsOoPCSGC^c{5bb0?< z?8T|Y#hLkex7bUIa^lnSi!>Q;u?IuM+@b`7U4w%?{r%ztT!VZa{apP*ZgHh$=A;%^ z7MG;vM)AO;Lm~rQe=+JOPZSi1a%Ny)C{|!#U`SysVaR4L5=dt#VMt-LVJKltVFIxv z8B&;gnSvQKS^RFXmgJ}87guqXBo=4uWt8ORXfhUYGcYh{G8M5gFfbG`GcYi$WGLbR zv3Vx*GZqSh0WcMrLXJBBc;z&$M0b75IB`+~I73_qNB9K*@ zoRejl3U=x(7LYG)F_u8x334ni0|Ub?=A_D0 zK~Qk;fkK~&i;;tghmnhsi;<17NQ!}h!B3O_7Hb+PLW)2h0QN^U^ZYZ?P8TmzJa!fvf~ug5)T0FoIpi jVUwGmQks)$#|Uzs5Ca2)0wWI-2iS2O%p8ndYyyk`pbDR# delta 429 zcmcb?{*9F{l$V!_fq{YH;jCwI+ZZSE$uNdY)RuH-WJqO9Wo>4RVoPU;VozmTz>&hV zkTHchg{6g|nK6npl`V@Sg*AmOg*}}qg`<}#g)@ZvE7#KoDG#PKPmgJ}87i%&VF*7hQ6tOcf zFsx)K;sCKZCeLRqZUAtNJ0 z3401lGh;AA3PUi1CaYf&Hvww`#3YzG Nm{^!O7`a#k7y&;aSD63+ diff --git a/Introduction to Computer Science/Website/Flask/tasks/app.py b/Introduction to Computer Science/Website/Flask/tasks/app.py index 40c3d0b..8a003d7 100644 --- a/Introduction to Computer Science/Website/Flask/tasks/app.py +++ b/Introduction to Computer Science/Website/Flask/tasks/app.py @@ -1,14 +1,17 @@ -from flask import Flask, render_template, request, redirect - +from flask import Flask, render_template, request, redirect, session, url_for +from flask_session import Session app = Flask(__name__) - -todos = [] +app.config["SESSION_PERMANENT"] = False +app.config["SESSION_TYPE"] = "filesystem" +Session(app) @app.route("/") def task(): - return render_template("task.html", todos=todos) + if "todos" not in session: + session["todos"] = [] + return render_template("task.html", todos=session["todos"]) @app.route("/add", methods=["GET", "POST"]) @@ -17,5 +20,7 @@ def bye(): return render_template("add.html") else: todo = request.form.get("name") - todos.append(todo) + t = session.get("todos") + t.append(todo) + session.modified = True return redirect("/") diff --git a/Introduction to Computer Science/workspace.code-workspace b/Introduction to Computer Science/workspace.code-workspace index 480d3b5..04b40b3 100644 --- a/Introduction to Computer Science/workspace.code-workspace +++ b/Introduction to Computer Science/workspace.code-workspace @@ -5,7 +5,14 @@ } ], "settings": { - "sqltools.connections": [], + "sqltools.connections": [ + { + "database": "${workspaceFolder:Introduction to Computer Science}/Website/Flask/register/lecture.db", + "driver": "SQLite", + "name": "lectures", + "previewLimit": 50 + } + ], "sqltools.useNodeRuntime": true } } \ No newline at end of file