From 757c1efc634e84734abef331306b0b08b3e08527 Mon Sep 17 00:00:00 2001 From: Claret Nnamocha Date: Thu, 5 Mar 2020 16:19:15 +0100 Subject: [PATCH 1/4] Create server.py --- server.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 server.py diff --git a/server.py b/server.py new file mode 100644 index 0000000..1565db2 --- /dev/null +++ b/server.py @@ -0,0 +1,3 @@ +from pytonik.Server import Server + +Server.serve(host="localhost", path="", port=60) From aa1f4337e83f4509874277d0716aafd1e3aa1b66 Mon Sep 17 00:00:00 2001 From: Claret Nnamocha Date: Thu, 5 Mar 2020 16:22:37 +0100 Subject: [PATCH 2/4] Update server.py --- server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.py b/server.py index 1565db2..56dd8c8 100644 --- a/server.py +++ b/server.py @@ -1,3 +1,3 @@ from pytonik.Server import Server -Server.serve(host="localhost", path="", port=60) +Server.serve(host="localhost", path="", port=6060) From 643c9a368683a565990477cede285dee9068aeec Mon Sep 17 00:00:00 2001 From: Claret Nnamocha Date: Tue, 17 Mar 2020 12:27:22 +0100 Subject: [PATCH 3/4] update --- README.md | 2 +- app.log | 2 ++ .../__pycache__/ErrorController.cpython-36.pyc | Bin 0 -> 924 bytes .../__pycache__/IndexController.cpython-36.pyc | Bin 0 -> 458 bytes public/__pycache__/index.cpython-36.pyc | Bin 0 -> 275 bytes requirements.txt | 2 +- server.py | 9 +++++++-- views/400.html | 4 ++-- views/404.html | 4 ++-- views/405.html | 4 ++-- views/index.html | 4 ++-- 11 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 controller/__pycache__/ErrorController.cpython-36.pyc create mode 100644 controller/__pycache__/IndexController.cpython-36.pyc create mode 100644 public/__pycache__/index.cpython-36.pyc diff --git a/README.md b/README.md index a372e54..b1bab36 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Build web applications using the pytonik Folder and file structure. -![pytonic folder structure](https://eduhubdirect.com/folder_structure.png) +![pytonic folder structure](https://betacodings.com/public/assets/img/folder_structure.png) This folder structure is commended by **pytonik** and should be used when developing web application. diff --git a/app.log b/app.log index e69de29..d9378af 100644 --- a/app.log +++ b/app.log @@ -0,0 +1,2 @@ +03/11/2020 10:12:22 PM, 473 C:\Users\hp\Documents\pytonik\Echo/controller - [error ERROR] - Controller does not exist JoController +03/11/2020 10:12:22 PM, 516 C:\Users\hp\Documents\pytonik\Echo/controller - [error ERROR] - Controller does not exist JoController diff --git a/controller/__pycache__/ErrorController.cpython-36.pyc b/controller/__pycache__/ErrorController.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..694a735735e0193d8ea68cc9cabe8f06d462a69a GIT binary patch literal 924 zcmbu7&2G~`5Pt+CTm1gG!_ z9C-m=X)hc&@d})naY_i{fKV;%%teOhIQL?wZ_DjdikQW~_I* zY=hMl5ICqQx9uDao(>-$hOb707bE0*t$Ui9voes@fuu@)myRBvdPVZaP=YpXN(L87 zNhLcPuabSKD!OY`V3V>18e620??RpvqxUY*ag)7Fj8{km61Ui1P3jNa?oB#d$5nWp zJeR`l{Sz0jG1#)x|ApJT{TJ>H@`QmOwJ%=U&U5n``Tf*$T=s#-QIDZ64mo74A9ZKy a8T$8UIn1Z#0l&49TfC(j+IRhy-~0*UZmf&| literal 0 HcmV?d00001 diff --git a/controller/__pycache__/IndexController.cpython-36.pyc b/controller/__pycache__/IndexController.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e15802bf4e19f71dc88b8788b249a46393930f48 GIT binary patch literal 458 zcmYjNJx>Bb5S{(FI{{G(8)Ij87FgIBV>C!XgGLa{<)S%nH{tNUvUi{)TA}~KKj2^5 z#=?rfVC5_j!zA5a{M!QM{9*22X5l!I zX<7LB(t_U#huKk>rKQT^SSr75mNft0jeM#qC}X}|R1ttuLWxaw*`nTYEw8rHY7FF~ iGACa+R5ioQ?83(yY-3GtoFA?5nW4_^=%h@dXT&mZ10Qd?zP8!@zkb4a1Qwb7Fs4z!_73i}Fi0u6==sy=7tV zr;Dy2)2Lc|PS*N}I@Nf7YmARxwnp67MO%?>ocJ#ki(*>~ i({4&t2&E-;=cf0QtE!f5N!NexToS-AWhtJr3H}1j)k9SP literal 0 HcmV?d00001 diff --git a/requirements.txt b/requirements.txt index 5dabba8..74d707e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pytonik==1.9.8a2 \ No newline at end of file +pytonik==1.9.8rc1 diff --git a/server.py b/server.py index 56dd8c8..73afd67 100644 --- a/server.py +++ b/server.py @@ -1,3 +1,8 @@ -from pytonik.Server import Server +from pytonik import serv +import os -Server.serve(host="localhost", path="", port=6060) +LOCAL_PORT = 6060 + +port = int(os.environ.get("PORT", LOCAL_PORT)) +host = "localhost" if os.environ.get("PORT") == None else "" +serv.run(host=host, port=port) diff --git a/views/400.html b/views/400.html index 2d32b09..c67f216 100644 --- a/views/400.html +++ b/views/400.html @@ -6,8 +6,8 @@ - - + + {{title}} | {{name}} diff --git a/views/404.html b/views/404.html index 2d32b09..c67f216 100644 --- a/views/404.html +++ b/views/404.html @@ -6,8 +6,8 @@ - - + + {{title}} | {{name}} diff --git a/views/405.html b/views/405.html index 2d32b09..c67f216 100644 --- a/views/405.html +++ b/views/405.html @@ -6,8 +6,8 @@ - - + + {{title}} | {{name}} diff --git a/views/index.html b/views/index.html index 85d9607..13ac1cf 100644 --- a/views/index.html +++ b/views/index.html @@ -6,8 +6,8 @@ - - + + {{title}} | {{name}} From 29da3426e6e778732b7c8d93041bf8e104ea56be Mon Sep 17 00:00:00 2001 From: Claret Nnamocha Date: Tue, 17 Mar 2020 12:33:11 +0100 Subject: [PATCH 4/4] Update app.log --- app.log | 2 -- 1 file changed, 2 deletions(-) diff --git a/app.log b/app.log index d9378af..e69de29 100644 --- a/app.log +++ b/app.log @@ -1,2 +0,0 @@ -03/11/2020 10:12:22 PM, 473 C:\Users\hp\Documents\pytonik\Echo/controller - [error ERROR] - Controller does not exist JoController -03/11/2020 10:12:22 PM, 516 C:\Users\hp\Documents\pytonik\Echo/controller - [error ERROR] - Controller does not exist JoController