From 1cb49c31275f83a309f52df6ef320838a82ffd4f Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 29 Oct 2024 23:15:37 +0000 Subject: [PATCH] add django_code_new just in case before removing it --- .../__pycache__/apps.cpython-312.pyc | Bin 0 -> 506 bytes django_code_new/dashboard/apps.py | 10 ++ django_code_new/db.sqlite3 | 0 django_code_new/django_code/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 138 bytes .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 177 bytes .../__pycache__/settings.cpython-312.pyc | Bin 0 -> 2603 bytes .../__pycache__/settings.cpython-39.pyc | Bin 0 -> 2321 bytes .../__pycache__/urls.cpython-312.pyc | Bin 0 -> 1481 bytes .../__pycache__/wsgi.cpython-312.pyc | Bin 0 -> 634 bytes django_code_new/django_code/asgi.py | 16 +++ django_code_new/django_code/settings.py | 123 ++++++++++++++++++ django_code_new/django_code/urls.py | 51 ++++++++ django_code_new/django_code/wsgi.py | 16 +++ django_code_new/docker_connection/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 146 bytes .../__pycache__/apps.cpython-312.pyc | Bin 0 -> 2331 bytes .../__pycache__/views.cpython-312.pyc | Bin 0 -> 419 bytes django_code_new/docker_connection/admin.py | 3 + django_code_new/docker_connection/apps.py | 46 +++++++ .../docker_connection/migrations/__init__.py | 0 django_code_new/docker_connection/models.py | 3 + django_code_new/docker_connection/tests.py | 3 + django_code_new/docker_connection/views.py | 8 ++ django_code_new/manage.py | 22 ++++ .../onenote/__pycache__/apps.cpython-312.pyc | Bin 0 -> 504 bytes django_code_new/onenote/apps.py | 10 ++ .../__pycache__/apps.cpython-312.pyc | Bin 0 -> 789 bytes django_code_new/paperless_django/apps.py | 16 +++ django_code_new/random_simpsons/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 142 bytes .../__pycache__/apps.cpython-312.pyc | Bin 0 -> 2758 bytes .../__pycache__/views.cpython-312.pyc | Bin 0 -> 419 bytes django_code_new/random_simpsons/admin.py | 3 + django_code_new/random_simpsons/apps.py | 68 ++++++++++ .../random_simpsons/migrations/__init__.py | 0 django_code_new/random_simpsons/models.py | 3 + .../templates/my_template.html | 1 + django_code_new/random_simpsons/tests.py | 3 + django_code_new/random_simpsons/views.py | 8 ++ 40 files changed, 413 insertions(+) create mode 100644 django_code_new/dashboard/__pycache__/apps.cpython-312.pyc create mode 100644 django_code_new/dashboard/apps.py create mode 100644 django_code_new/db.sqlite3 create mode 100644 django_code_new/django_code/__init__.py create mode 100644 django_code_new/django_code/__pycache__/__init__.cpython-312.pyc create mode 100644 django_code_new/django_code/__pycache__/__init__.cpython-39.pyc create mode 100644 django_code_new/django_code/__pycache__/settings.cpython-312.pyc create mode 100644 django_code_new/django_code/__pycache__/settings.cpython-39.pyc create mode 100644 django_code_new/django_code/__pycache__/urls.cpython-312.pyc create mode 100644 django_code_new/django_code/__pycache__/wsgi.cpython-312.pyc create mode 100644 django_code_new/django_code/asgi.py create mode 100644 django_code_new/django_code/settings.py create mode 100644 django_code_new/django_code/urls.py create mode 100644 django_code_new/django_code/wsgi.py create mode 100644 django_code_new/docker_connection/__init__.py create mode 100644 django_code_new/docker_connection/__pycache__/__init__.cpython-312.pyc create mode 100644 django_code_new/docker_connection/__pycache__/apps.cpython-312.pyc create mode 100644 django_code_new/docker_connection/__pycache__/views.cpython-312.pyc create mode 100644 django_code_new/docker_connection/admin.py create mode 100644 django_code_new/docker_connection/apps.py create mode 100644 django_code_new/docker_connection/migrations/__init__.py create mode 100644 django_code_new/docker_connection/models.py create mode 100644 django_code_new/docker_connection/tests.py create mode 100644 django_code_new/docker_connection/views.py create mode 100644 django_code_new/manage.py create mode 100644 django_code_new/onenote/__pycache__/apps.cpython-312.pyc create mode 100644 django_code_new/onenote/apps.py create mode 100644 django_code_new/paperless_django/__pycache__/apps.cpython-312.pyc create mode 100644 django_code_new/paperless_django/apps.py create mode 100644 django_code_new/random_simpsons/__init__.py create mode 100644 django_code_new/random_simpsons/__pycache__/__init__.cpython-312.pyc create mode 100644 django_code_new/random_simpsons/__pycache__/apps.cpython-312.pyc create mode 100644 django_code_new/random_simpsons/__pycache__/views.cpython-312.pyc create mode 100644 django_code_new/random_simpsons/admin.py create mode 100644 django_code_new/random_simpsons/apps.py create mode 100644 django_code_new/random_simpsons/migrations/__init__.py create mode 100644 django_code_new/random_simpsons/models.py create mode 100644 django_code_new/random_simpsons/templates/my_template.html create mode 100644 django_code_new/random_simpsons/tests.py create mode 100644 django_code_new/random_simpsons/views.py diff --git a/django_code_new/dashboard/__pycache__/apps.cpython-312.pyc b/django_code_new/dashboard/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..261f91796a196b100d5ddb08f92028f9c9eee07e GIT binary patch literal 506 zcmX|;Jx>BL7{^=g6%GuE0}KurbYOviD6#fE%yKPQYcSijiTQ%u;-k^BepKNWUKY>e_<~1wlkprc z%flpzuc(Z9Bq=0KK_fy1kS!>g2LCbqu2biH`pCkA!=WEm|jGk)!pgR~+ z#(0BxGPvcQAPta&4o0YN3HmUlGLg#F*fcvnC$vNEy=csDw!E`-yf~Ka_;G0js-AGb zVMCV(Fg&AAr?#kfKb+n|@1>xiR%z*M3$>L~s59@C04^*HrBw4ZGT9M$ih-N zJ(+|QUc-wB53>#DNR(At{oKaxhn!3q9f(7isvF277=AU3@fsbk(a9P$*XVSGoE561 JI>u+2`ya=mdtv|p literal 0 HcmV?d00001 diff --git a/django_code_new/dashboard/apps.py b/django_code_new/dashboard/apps.py new file mode 100644 index 0000000..4e31abe --- /dev/null +++ b/django_code_new/dashboard/apps.py @@ -0,0 +1,10 @@ +from django.apps import AppConfig +from django.http import HttpResponse +from django.shortcuts import render +from django.shortcuts import redirect +import time +import random + +def hello(request): + return HttpResponse('

Hello dashboard h1>') + diff --git a/django_code_new/db.sqlite3 b/django_code_new/db.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/django_code_new/django_code/__init__.py b/django_code_new/django_code/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_code_new/django_code/__pycache__/__init__.cpython-312.pyc b/django_code_new/django_code/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..879bacb2620408bf3ef27dd4fcf1d6a7c3f714fa GIT binary patch literal 138 zcmX@j%ge<81WwoHr-A6lAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxdrKz8spOUJdl9ia3 wo*$3Fj*rjG%PfhH*DI*}#bJ}1pHiBWYFESx)X50M#UREg`kf>};1sUZ3>h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o10OKO;XkRlgup zx3oexIaNPBvqaw|D={xUKfWlnEVZaOHNK!IzoJqB$gSv4=_N*i#^A|lPX&6A6ZDc(hm>TivVppS#ND08H^XmdcJ)g<9wFef z^4pKCzhVUOhqD-c0>jC>K1{wR5Wy3OL>`$`JiLb_JOuV&@6Y7GYCAk~I~ji-PPg3{ zCvs)2B$A&(DRcp>QYh^{FS^f56500gNi@Sxqgg%$F)zR`jV|*S(Hwti z?@H#XcpF|VQrH&NwniD)G$pldP%TZTkSi0K8p2dZ*S2xfq$80vtYTd>F`_p2s2c;D ztcVmzr3_Ql&7tKDs%roeH3VL!m*~6Ty$ZOBrejJ{A%r5DlBQDdHMb-PD#`d0$N@*T zOtWKrn#&=rY0!fhqYRpwlEZ2a0CT3+k(x$slyq(YZ*F0#)see6HCXfu|R)1dz&F`UsW`>td$`Pl4{^)SI61=iyvo%c|5N@%p!S7`}&^J z>Z0s|zI$u=)`OkBtcn&kEi7UE`prAbVkg^qSkHK^IUVm{-N3Y|@0prPw=ocnb(6+j zE57(}iC(<-fL^8-Z{M~q4#L?&eq*CZ%1-{K|yTalxu-?sc$X z%}gi_Y#6Xzrxgk)#5Q=$O?sHH!A)mdjZDzW4z-Gekc@Xl9n&sflDS874skG9Kh{~x zlVHQ}^q4<4kd1j|P6vUCQGm|8JN$>Kp||KfJf2B-cg*zuL@pwbH=YLrYv4_4x&=Mv zIQbGIs>Yqy2lS13-835jXCk?~nKCt*%o(FkvL+t$K4EOq<> zy3e$34Q-DL)nWAvWQT3*&V=zXlV>=LbQzx=Tw(H0*>b`56^b>^4l&iL;Ld`TYQ0z~ zbJo=X@PM>kqb<>5rvq%eTWJRoZi!vlJg#lDdBUObLY7Q?$BKY(IL~wrkklMm=u@;m&}z$ypx^ zVSz~nE*#mQSEM$ym9{Ej8I?0Lc2E%DIuHaq*nvY=mNs=SP-}+-!8u?YxsDA@-obXD z180kB+MyMOW1Zc$BOIHrv321o`<3l4uq%xZg6Ww$G%j|Gfp+x;Q~`v8CWE!&?6wY zE91xdb?|il*BJ0Ohv<7rl05Q6NZ;SH1bO)=K*W;Yg}#0KCVFi@dhOTf{F~^)estkY zba6kr*bDU&M50FaBK-gnj`#e(C;49dZ6uiT^b&7Vp@auCX(IVyFV+tcX_h=lrVi4x zhcW6c;h#_Ry}@+kC>-+#`rbs`(+l@0BE9sQNCK)qagd@9lCwWN+E3m%@_UnD<9BW5 zi15_wB;WUXz%S%3s^g0<#uv50;$r-&=QT0gzfMfg_Tq=J>0bCSI@JpuLehbLj7ZEt Qq7mZK-F+gZe*|3o1MgB|RsaA1 literal 0 HcmV?d00001 diff --git a/django_code_new/django_code/__pycache__/settings.cpython-39.pyc b/django_code_new/django_code/__pycache__/settings.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..23dd015eef2f2c329c4933590dba2c2fe21deb9a GIT binary patch literal 2321 zcmb7FOK;mo5T<16VZ}}yJFg~a!6IlAB^8MzZXQLEh8AgCh+Z%$yXBz-rCrJE@Ri-A z9rN0MQRL9(P@w%uy!O;T&_hu)9a6F_%K_^0vE1F6`DXUpnWeM1SP|g*aZSX(EeOKz z>0tUQ!r%qG>=$T|Um zIjaKSB785PlC^+9f<%%T|Em#-PBD#o+=+Z3#ExpZ?oOKCZM$4dc z8LedPm8`u=awE}NLf5Rz=(@EG-d5nff^Jw>(MQ%bbkh*3x15JLL8xeZjz0<{hB+tx zh)KhMN)+#7%CH^M;LV`~?H(R*xl-A{KBf-GNa`O-cTi?obC5@TiE)SWiRK+CVt^%0 zpjYLG@|R$}4#-|Wu|#}u;yIiIz61~7CE%90_zQ>vS9UoM*;k5!f&r7qK8_+71fGI@ z1ppNugk->!qp+1RJm1CAFmheVC5%hK@MKwzkH8ToRN8mk2($m=i{jywqd#Dag=#Jl zyAI!t*Cs3wpW#77aqY>2&#Lxqd^>nnL+-=i`^VleLbZGJ;Qs3Ur~8LBAKmN6m|*(( z-AAiVSPP$-)na^Q3?mN$pHtG8Gg9M~+1Us@-kOL- z1Qs`EEjVnxcl>BZ z`IyTO7#zu}Vp3XD>o4`TmWWzo%Sg&9b#SFa}}+lHgu zwv$o_2c}E!2~3UkyKg@O>62q>Xx1?Y;`)O-P>x`JMHyk-qc&& zrfTX&vb1AtG*bO$qpqg;l+0_Ysitm?XVh>9*B@lqvTh;KqZe?WCCYOba460lA)fPnI=(UF|hZ8<0EpdP8q&zY6qI zU?FS%+E#W04=W+5MQ>^Ytc(a(w5-DIQ(2z=5?^7eoSr;AI{G2X;bBt#8nz^I@pJgk z3v3e_abaO@sU*&cd9hHQFIPk{pMyJJexLtad@nAErF2~U2l|WR`@A^y{wc12ReBf2 F!oQn+Au#{| literal 0 HcmV?d00001 diff --git a/django_code_new/django_code/__pycache__/urls.cpython-312.pyc b/django_code_new/django_code/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e53a372591ea43eb25b8fea582142903dc07f573 GIT binary patch literal 1481 zcmb7EO>5LZ7@lmiA4%;8Dy6j+MnrZ4ZGu)&7psUUisC`^;9lZ%XLdIw$%L7#wR_W( zC+W?4@+|%oFD-j01`2|B@MaM&o_r@CwiW!EL-Nd-sd;??xE*SPgPz*Bd$Y(?{EE#K>7)CFSBiVEu%G=V; zk{0ROJaAa(oVCw5F^{~qbQIZv^wKe}KOq5V$)eJq9_k$HdFqYoUbZS1?;O3mO`<;M!i0t*VW?zo5vvu*iv2Lx@BJTiIfY= zP#E2(`a2gq?lGZ^*s0^f&P~wzA2*6`6X`0EhV_f1TVdPpQ!ng76ViODG_}h`e{Q9X z!C(cpM{!xh!kxU8&8%J7cG#-ng~^;dpEl*6-7fpQ>p%mGOm!7Vb?cU8epa`^(vmWv zffoYMRmasEdL##x9`k+f3=9dIDS0TJ!8qlsq0b3*JD$&+!DK`tCg3!{5y{BoJY-Nf zE9R4w$lfw1g65IC)_78NT{w2Gn~dj`LW5%AEsGH_l#K2xU+5|_AxKDh;1)(iSw;7f zyV;7QnkP?;pIMV~YAmT0Ym>19H6)|^&fFXH6@=0EQ;xcRPNte(#RFLFiyf_fuU!f_ z?fdMqQ2#0T3nKXf9$!W@P1`L^X!h4^KAt_uw>Ji-JDz4o?G0STO8_V mcWY^EX5;+prB_R!Qjj(tzII=^Lw(`PiDMI`r=#L9So#4xq@&LO literal 0 HcmV?d00001 diff --git a/django_code_new/django_code/__pycache__/wsgi.cpython-312.pyc b/django_code_new/django_code/__pycache__/wsgi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..afc81f390084b1cffb046f303be38b09b4b88774 GIT binary patch literal 634 zcmY*XF>ezw6t?d|Q#mw3sO@Ya7$U)4K}-lCQMHYNARSVKl;z@{-zAQG_UY`VO}9>r zjEu~vKZT_T1k$m95Ca=1TPJ+IMh$Q9`|RiMeV?EFVP%CN7n@(+C2uf7Kg-QLYL{TP z@4#EcQ6F*4J&F6+WnX%!-}f;BJYJqtuJX8Xh3AOZ__b57+F|4&@J}yG{iUhbS~~tl zUiI1?8f%q^Ax(5n`IxDpj$+M$X1N|iYy(0%mcmh{4H#-iKr0fHlI=^N%uq&C%?~8p zlQ02ECoC5iCB;(UbTD99CPmDw&}uMn{dSyEs&k-1Innf@K(%tsg`tU%aF-eYGO{)^ zkHV1a*aVfcxu;mCA*k?S@E{!NL#sm$nbgx1lnoEfP=w@n`P6O;7pp_CQF#_E*eKSw zo;~fhccb3+-d?BM?nN(lw_ZNqK3-jzKw!XHp@ybaFX~a`Y(!DvX;a*&E(NiBLr}KP zeJ57bK}|%iRY4q)L&6TEEgB1|@6oJub$%x-2OKU){fEnrK{h>Keq4?9N#1lU_g#?L zaLXSbWBk{v/', docker_connection.apps.docker_call), + + +] diff --git a/django_code_new/django_code/wsgi.py b/django_code_new/django_code/wsgi.py new file mode 100644 index 0000000..7a52be5 --- /dev/null +++ b/django_code_new/django_code/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for django_code project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_code.settings') + +application = get_wsgi_application() diff --git a/django_code_new/docker_connection/__init__.py b/django_code_new/docker_connection/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_code_new/docker_connection/__pycache__/__init__.cpython-312.pyc b/django_code_new/docker_connection/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e5ff04a8f233f35f99a89ea3fc2f3422179a67f GIT binary patch literal 146 zcmX@j%ge<81RhJ~r-A6lAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxdWvHK=pOUIylv+1{Q+K-YeIT>M8t=r8fnpjagAQV>>=iA-#xGR|WxWXYDwa$XK(*;dN2d@PU^ zJD!h&K4!O-)w~+5CGrUgT}5X69x~eqUXw%L`J}1dL-~}M0G>9Jz}w9f@Qy_#oBmrE zWwD=_@VrUaDO$5nv7f%ix%VYup6f6I$~YyCN$50)$s5#ND7y<2H$E?f{zHzVkKF?x ztRjN)*hG2B#Ch42^2(x|RebHTQJ8m&MXNxA$Jw>}B z#5ZSh1=uM^$sIx&(LFfMV$O66^MvXJ*KtUJTdtEcJdX`|i!=fM1WW~iwFA3{wvLR| zltWvo!{1$@T@8JqfdDKZ0lj#3dw{JX-qe|REs}4dtTbIcGCp_i;!SQ)-Z$gA^NhoR z`^R&zNTF0jV%jLVT_KD!@n0Y92JXk^h;6&{AjoNWSO>7XXghVd)-$}G8mTEGL0oTz zB-{ld{Rje78eYbxWXh)UtF$b&0xU_O-bYJ#NqQDri!{qJZ&WQ>l1uS@#_-uVB1T-m z7tsG(0vPe>>ghQsyH9dC&!yb3972bxq{4<~384m|e27#aEmjUPJD2lghFP|pYR4^J zzA$!b^44(qi_wwUtmLa-F+xSgef5UH*tae<0Y;_7Tu0PU15RJ@T*m#FM=gi@3MUJk zigRTZDoWUwE7bO5l|`JkAt=o9ySi_F52q&bVc6k z9ju+bRM#d}VlUGN9$deF{n5Y^vXTCH1;13=SBwY6`^E3uw>ytMns_|*^VE9hKusNZ zH*W&pAaCbEc)OIs{6S_!a6rqL3(J6(_7)mo+an4c`t}`2t15L}e#tY+)wF3r{ZpOU zm+lNtWo2Kf0F=J!MKJnF=ozcHs553~CE5lXg^)=hWNpzNOjJq)75zw92_{;B^#OxQ z?atJCFZ@xe-85z#u&buh%Bc@p?TSga>S$nnazo3$ z-+HvJjc#ZcUP9$hZD!8YGiNq4=jxerzh~Do z*Uc3%jzVCx$cD|q5G_r#-p#|ZFuli Pw}emZsww;#4m|${JM{cr5g18iL?6d$CJ#^LN1%EZ8b=*YrS@lzP6 z#1_HC#D)~HbmANZIO*=5pY`7P{9LcEF^cZv!`Tb<4|Dhps|2}EV8#R!JZ2-_=iFc` zwnlc}F7Q8Z-?P3mbv*aeh&`UIAS42C&a?Hd*6A^*R3-{SUYeU`mzg&R%$WYW6a1;f zC(N^Yx7+Qg)#*YU%jVI=X>u-i+W|4?kd9_m5U$3cv@)XR(hou@AV8P^Dj1|FZ>E8e z;U(Z8lt}`i9?B$`4B=Y&=`?dAzE3@O II6o|8Khe!%CIA2c literal 0 HcmV?d00001 diff --git a/django_code_new/docker_connection/admin.py b/django_code_new/docker_connection/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/django_code_new/docker_connection/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/django_code_new/docker_connection/apps.py b/django_code_new/docker_connection/apps.py new file mode 100644 index 0000000..82601dd --- /dev/null +++ b/django_code_new/docker_connection/apps.py @@ -0,0 +1,46 @@ +from django.apps import AppConfig +from django.http import HttpResponse +from django.shortcuts import render +import requests +from proxmoxer import ProxmoxAPI +import docker + +class BackofficeConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'backoffice' + +def hello(request): + return HttpResponse('

Start bookstack!

') + +def http_call_test(request): + url = 'http://portainer.zeus.geeraert.eu/api/auth/' + myobj = {'Username': 'admin','Password':'Xtm78*CX3mJ54g'} + + x = requests.post(url, json = myobj) + + print(x.text) + return HttpResponse(x.text) + +def proxmox(request): + proxmox = ProxmoxAPI("proxmox.zeus.geeraert.eu", user="root@pam", password="dinner_sl@v3", verify_ssl=False) + return HttpResponse(proxmox) + +def docker_call(request,action,id_docker): + print(action) + print(id_docker) + client = docker.from_env() + if action == "start": + print("nous allons start") + client.containers.get(id_docker).start() + if action == "stop": + print("nous allons stop") + client.containers.get(id_docker).stop() + + return HttpResponse(client.containers.get(id_docker).status) + + + + + + + diff --git a/django_code_new/docker_connection/migrations/__init__.py b/django_code_new/docker_connection/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_code_new/docker_connection/models.py b/django_code_new/docker_connection/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/django_code_new/docker_connection/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/django_code_new/docker_connection/tests.py b/django_code_new/docker_connection/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/django_code_new/docker_connection/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/django_code_new/docker_connection/views.py b/django_code_new/docker_connection/views.py new file mode 100644 index 0000000..dcf84f6 --- /dev/null +++ b/django_code_new/docker_connection/views.py @@ -0,0 +1,8 @@ +from django.shortcuts import render + +# Create your views here. +from django.http import HttpResponse +from django.shortcuts import render + +def hello(request): + return HttpResponse('

Hello Django!

') diff --git a/django_code_new/manage.py b/django_code_new/manage.py new file mode 100644 index 0000000..9a915ed --- /dev/null +++ b/django_code_new/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.?""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_code.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/django_code_new/onenote/__pycache__/apps.cpython-312.pyc b/django_code_new/onenote/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c91f9a37d575138a2196c21390a48613940265bb GIT binary patch literal 504 zcmX|;zfS@&6vtccCma|O2N)b6>c9d4S3+W3h%pSh-D1eKa+u!rY|DU?gZ~461MyFB zA#nqVgOi)dIWhTqo-}Fu>G!?wyVu@prBXsLu0E=hAJ{+j;eQlzNG|~vh#-O)im;Ed z<^n53hHqqSFf+1zD`OMb_U()<=J*ceTFmubVm~9lIJa8PmoD7G>*9HmT=4jAI$7d% zd8kx!O=ZGkNg-$p8WSpjTtUfH&_Im>oVTPmBcEvgz@J=XeRcQB-k z@dl4+%oS}mv?NS0LVZWjhZ&VhYFA^|>;#<94!Ix46MmaHello onenote!

') + diff --git a/django_code_new/paperless_django/__pycache__/apps.cpython-312.pyc b/django_code_new/paperless_django/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..350d9eb53ef106aab3d7d7cc5339a045726323f0 GIT binary patch literal 789 zcmY*XJ8u&~5Z?7Ye9pxQNQjsQ*@7rs3ZGCy15qRdMQ9=f-8I(9yS5MAi`l)x2&5Dg z`3FHjK^yT?Xe@>55=%(XP=RolirKYuQAXO)xAWR>X6IY8xkOO5{(KpHq=fubmkX&a z!0b7KBfK72^?m>CqaYNQ7?@x z&-ty&d$epk&hsZ(I*5kHv|QekGJnBEo~44L(*~Y04u~A!ECSw_`+X!@iGfI+Sqs$> zk(H0puM7N=c(wgEw{}MNclUT4XYD-9ImBFuPFoql#8iBt4*Ye&g%m2UeZJ}UGsb=P zDolr2Pva`FH@Es>o{MfiF0GL&3@#=*c*F{-19IlBO(ov!i_ifGOq>l^#t_df-TCagYIdMnt1OB;s20m>ix@G=K=unM zz((_&ttq2~<6?v<%Mv|u&ElBo2Q=MtXD7*65%XP8YoY#AbWr^@D5X=Hello paperless!

') + +def redirect_authenticated(request): + + final_url = "https://paperless.tryton.geeraert.eu/" + print(final_url) + + return redirect(str(final_url)) diff --git a/django_code_new/random_simpsons/__init__.py b/django_code_new/random_simpsons/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_code_new/random_simpsons/__pycache__/__init__.cpython-312.pyc b/django_code_new/random_simpsons/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0cd810f9dd56bede14764475368b29924c1d1833 GIT binary patch literal 142 zcmX@j%ge<81WwoHr-A6lAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxdrK_KupOUJdl9ia3 zo*xfp7bWJUlIY~;;_lhPbtkwwJTx;>ShGuVi4ma MGb1Bo5i^hl0F2}zYXATM literal 0 HcmV?d00001 diff --git a/django_code_new/random_simpsons/__pycache__/apps.cpython-312.pyc b/django_code_new/random_simpsons/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f93589b95de010fd156278377c7f7831a33403e9 GIT binary patch literal 2758 zcmahLOKcNIbk<%w>)3HZlR!dI>JT8csMjGlP-vh^NFY%mKvMeg0e9ma<8AiWnKdQG zmVD?T>Y<|QfmTH-syKkS^w2|(9I9S=v1O!23rLmP9(+Rt_0Ut_talxoR_#dp_U)VZ zn|Z(exu>Ta!TR&FT~~e!A@m#j@RrX-woE{7A{oh?iZm|GaSZpVKFy!@JGfuvwLm)H z;5^{LbkM;AYL_OY1qTnRp>zo3f@*iV+j)o6VY%xQl#a*(z#cgSFe-Ng>|GDW!wqIW z&e@?E(>!J9IpxYd&WPRTI-LX>;Xx9VcM<$i0aJ@IvDjbn zWY&;zQvOiVuNWBzCz383T86sfNy#*+Xs+9VJX1>|AlCyAjRL5k$KhSop~-sqaFsv2 z1r*fbH#5q7-&z6yLEy@q>?`}){P)ZJeK%BPzr}c+Rq}i1D)Uyrqsjq~3a1S&6$g{D zWJyWc_*hpBNlwCXB|?fbZ|AW%Yphdoa^lc2ab+SkKQSdv9y&5%iVJhghbAtl1uDKf zKfA1$;*nDe;mQ{uw>JEsyCR%S$P?P_tlsd=riiiwUbOp~)xcCBD0b$rdrszyOh z>INfEPE4i}6Gs!1uP09#1wyf?$u>udpKb@jbFUc)MxT~qd4h8%#;;$GotvLqoXK2T zJ{v2S;nR&o4pKlQSd}d0D$baam51%|lP@snl7@jkos>>GL1wyF*Kw@VV%%@@hKY3| zz&#RnnehN&g=2T+R7bZhFndg!9ioPYGwjn2xA{VuSd1+aW|BRg35S&o0_`Pu=y3oQ z^lNl~<;-U9a%JIp6zv$S4z5%$y;tvhzq0uFrJXm{zerZzg1mW(&@lEv(nNATzymoS zVTqOXDi?4RgvUvs4L~6A8O>QAwsU#3R-(8Bc$HcO0%_Of(Jkl}%~kS23Awtw@7Fs|{wZxI@uZMaOT%yem9W?1zH4ux=&h6exA7 zSc;*?1GdkgHqS!Is$EhYEOHud+Up3U4-|T_;hh*n7+1zJnh^oHX78{=Y&XLq_F`nh zt;lEw83l#xp=SUizM`*~h&v-J2aGo+jdI9w)3{qwoS6N@9{x`hL(z{Jj@z;Jegcm zD9uX5G7Md`3^R#Mg|eP+<#EDm@(GG1Xr7727|}rq9J1d74R)hsyaP0L zwRTw>*k*2G@eW#JfPFf&S35Rd6l=gVqbG`#hOQ<$798PnsiOk3R=v_ z#oSZJat4W6d4;-cz~#xg96$*rTs#3)8*HkD!3lFw(Jeb*687>_ixAdO;$6*V8u2bO zQy{9nLoaABJ2FNt<2q#TbdikfR;I~fN4<&b#DKQGT_;$r>ypZ}Qf7}eVOY&REO%HSuVch97@jh=5iR@2=utw9OupD+z PkpMTawR4Dj)zSJlpYEPM literal 0 HcmV?d00001 diff --git a/django_code_new/random_simpsons/__pycache__/views.cpython-312.pyc b/django_code_new/random_simpsons/__pycache__/views.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6faa35c550f1ff56632582cd565e53dc569630f GIT binary patch literal 419 zcmYLFJx{|h5Vi9`3#Et!=vagpvLuwb>cr5g18iL?6d$CJ#^LN1%EZ8b=*YrS@lzP6 z#1_HC#D)~HbmANZIO*=5pY`7P{9LcEF^cZv!`Tb<4|Dhps|2}EV8#R!JZ2-_=iFc` zwnlc}F7Q8Z-?P3mbv*aeh&`UIAS42C&a?Hd*6A^*R3-{SUYeU`mzg&R%$WYW6a1;f zC(N^Yx7+Qg)#*YU%jVI=X>u-i+W|4?kd9_m5U$3cv@)XR(hou@AV8P^Dj1|FZ>E8e z;U(Z8lt}`i9?B$`4B=Y&=`?dAzE3@O II6o|8Khe!%CIA2c literal 0 HcmV?d00001 diff --git a/django_code_new/random_simpsons/admin.py b/django_code_new/random_simpsons/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/django_code_new/random_simpsons/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/django_code_new/random_simpsons/apps.py b/django_code_new/random_simpsons/apps.py new file mode 100644 index 0000000..59c6272 --- /dev/null +++ b/django_code_new/random_simpsons/apps.py @@ -0,0 +1,68 @@ +from django.apps import AppConfig +from django.http import HttpResponse +from django.shortcuts import render +from django.shortcuts import redirect + +from django.core.files import File + +#from django.template.loader import render_to_string +import time +import random +import mimetypes + +def hello(request): + return HttpResponse('

Hello Simpsons!

') +#

href="{{ STATIC_URL }}/files/somefile

) + + +def download_file(request): + # fill these variables with real values + fl_path = '/data/download/sonarr' + filename = 'The.Boys.2019.S04E05.2160p.HDR10Plus.WEBRip.6CH.x265.HEVC-PSA.mkv' + +# fl = open(fl_path, 'r') +# mime_type, _ = mimetypes.guess_type(fl_path) + +# response = HttpResponse(fl, content_type=mime_type) +# response['Content-Disposition'] = "attachment; filename=%s" % filename + some_file = open('/data/kubernetes/Backup/nextcloud/notes/2024-07-28/Course.md', "r") + django_file = File(some_file) + return HttpResponse("

Hello download!

{{ django_file.name }}

bye download!

") +# return response + +def download_mo(request,file): + path_to_file = os.path.realpath(file) + response = FileResponse(open(path_to_file, 'rb')) + file_name = file[5:] + response['Content-Disposition'] = 'inline; filename=' + file_name + return response + +#def template(request): +# rendered = render_to_string("my_template.html", {"foo": "bar"}) + #return HttpResponse('

Hello !

') + +def simpsons(request): +# simpsons_url = "https://www1.kisscartoon.online/episode/the-simpsons-season-"; + simpsons_url = "https://kisscartoon.top/episode/the-simpsons-season-"; + number_of_seasons = 35 + seasons_maximum_number = [13,22,24,22,22,25,25,25,25,23,22,21,22,22,22,21,22,22,20,21,23,22,22,22,22,22,22,22,21,23,22,22,22,22,18] + + #print(simpsons_url) + + random_seasons = random.randint(1, number_of_seasons) + print("random seasons: "+ str(random_seasons)) + + #random_seasons-1 because list start at index 0 + print("maximum of episode for this season: "+str(seasons_maximum_number[random_seasons-1])) + + random_episode = random.randint(1, seasons_maximum_number[random_seasons-1]) + + print("random episode: "+ str(random_episode)) + + + final_url = simpsons_url+str(random_seasons)+ "-episode-"+str(random_episode)# + print(final_url) + +# return HttpResponse(str(final_url)) +# time.sleep(10) + return redirect(str(final_url)) diff --git a/django_code_new/random_simpsons/migrations/__init__.py b/django_code_new/random_simpsons/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_code_new/random_simpsons/models.py b/django_code_new/random_simpsons/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/django_code_new/random_simpsons/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/django_code_new/random_simpsons/templates/my_template.html b/django_code_new/random_simpsons/templates/my_template.html new file mode 100644 index 0000000..9cec98d --- /dev/null +++ b/django_code_new/random_simpsons/templates/my_template.html @@ -0,0 +1 @@ +

Hello template!

diff --git a/django_code_new/random_simpsons/tests.py b/django_code_new/random_simpsons/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/django_code_new/random_simpsons/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/django_code_new/random_simpsons/views.py b/django_code_new/random_simpsons/views.py new file mode 100644 index 0000000..dcf84f6 --- /dev/null +++ b/django_code_new/random_simpsons/views.py @@ -0,0 +1,8 @@ +from django.shortcuts import render + +# Create your views here. +from django.http import HttpResponse +from django.shortcuts import render + +def hello(request): + return HttpResponse('

Hello Django!

')