From 83e2ba5be215c91b2d2fced3a5c127755e1f9471 Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 29 Oct 2024 23:17:04 +0000 Subject: [PATCH] update code with latest version --- .../__pycache__/apps.cpython-313.pyc | Bin 0 -> 506 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 0 -> 138 bytes .../__pycache__/settings.cpython-312.pyc | Bin 2603 -> 2603 bytes .../__pycache__/settings.cpython-313.pyc | Bin 2603 -> 2603 bytes .../__pycache__/urls.cpython-312.pyc | Bin 1481 -> 1908 bytes .../__pycache__/urls.cpython-313.pyc | Bin 0 -> 1908 bytes .../__pycache__/wsgi.cpython-313.pyc | Bin 634 -> 634 bytes django_code/django_code/settings.py | 1 + django_code/django_code/urls.py | 7 + .../kubernetes_connection}/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 148 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 0 -> 148 bytes .../__pycache__/apps.cpython-312.pyc | Bin 0 -> 3047 bytes .../__pycache__/apps.cpython-313.pyc | Bin 0 -> 3028 bytes .../__pycache__/views.cpython-312.pyc | Bin .../kubernetes_connection}/admin.py | 0 django_code/kubernetes_connection/apps.py | 115 ++++++++++++++++ .../migrations}/__init__.py | 0 .../kubernetes_connection}/models.py | 0 .../templates/my_template.html | 0 .../kubernetes_connection}/tests.py | 0 .../kubernetes_connection}/views.py | 0 .../onenote/__pycache__/apps.cpython-313.pyc | Bin 0 -> 504 bytes .../__pycache__/apps.cpython-313.pyc | Bin 0 -> 789 bytes .../__pycache__/__init__.cpython-313.pyc | Bin 0 -> 142 bytes .../__pycache__/apps.cpython-313.pyc | Bin 0 -> 2753 bytes .../__pycache__/apps.cpython-312.pyc | Bin 506 -> 0 bytes django_code_new/dashboard/apps.py | 10 -- django_code_new/db.sqlite3 | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 138 -> 0 bytes .../__pycache__/__init__.cpython-39.pyc | Bin 177 -> 0 bytes .../__pycache__/settings.cpython-39.pyc | Bin 2321 -> 0 bytes .../__pycache__/urls.cpython-312.pyc | Bin 1481 -> 0 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 --- .../__pycache__/__init__.cpython-312.pyc | Bin 146 -> 0 bytes .../__pycache__/apps.cpython-312.pyc | Bin 2331 -> 0 bytes django_code_new/docker_connection/apps.py | 46 ------- .../docker_connection/migrations/__init__.py | 0 django_code_new/manage.py | 22 ---- .../onenote/__pycache__/apps.cpython-312.pyc | Bin 504 -> 0 bytes django_code_new/onenote/apps.py | 10 -- .../__pycache__/apps.cpython-312.pyc | Bin 789 -> 0 bytes django_code_new/paperless_django/apps.py | 16 --- django_code_new/random_simpsons/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 142 -> 0 bytes .../__pycache__/apps.cpython-312.pyc | Bin 2758 -> 0 bytes .../__pycache__/views.cpython-312.pyc | Bin 419 -> 0 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 - django_code_new/random_simpsons/tests.py | 3 - django_code_new/random_simpsons/views.py | 8 -- 56 files changed, 123 insertions(+), 395 deletions(-) create mode 100644 django_code/dashboard/__pycache__/apps.cpython-313.pyc create mode 100644 django_code/django_code/__pycache__/__init__.cpython-313.pyc rename django_code_new/django_code/__pycache__/settings.cpython-312.pyc => django_code/django_code/__pycache__/settings.cpython-313.pyc (84%) create mode 100644 django_code/django_code/__pycache__/urls.cpython-313.pyc rename django_code_new/django_code/__pycache__/wsgi.cpython-312.pyc => django_code/django_code/__pycache__/wsgi.cpython-313.pyc (60%) rename {django_code_new/django_code => django_code/kubernetes_connection}/__init__.py (100%) create mode 100644 django_code/kubernetes_connection/__pycache__/__init__.cpython-312.pyc create mode 100644 django_code/kubernetes_connection/__pycache__/__init__.cpython-313.pyc create mode 100644 django_code/kubernetes_connection/__pycache__/apps.cpython-312.pyc create mode 100644 django_code/kubernetes_connection/__pycache__/apps.cpython-313.pyc rename {django_code_new/docker_connection => django_code/kubernetes_connection}/__pycache__/views.cpython-312.pyc (100%) rename {django_code_new/docker_connection => django_code/kubernetes_connection}/admin.py (100%) create mode 100644 django_code/kubernetes_connection/apps.py rename {django_code_new/docker_connection => django_code/kubernetes_connection/migrations}/__init__.py (100%) rename {django_code_new/docker_connection => django_code/kubernetes_connection}/models.py (100%) rename {django_code_new/random_simpsons => django_code/kubernetes_connection}/templates/my_template.html (100%) rename {django_code_new/docker_connection => django_code/kubernetes_connection}/tests.py (100%) rename {django_code_new/docker_connection => django_code/kubernetes_connection}/views.py (100%) create mode 100644 django_code/onenote/__pycache__/apps.cpython-313.pyc create mode 100644 django_code/paperless_django/__pycache__/apps.cpython-313.pyc create mode 100644 django_code/random_simpsons/__pycache__/__init__.cpython-313.pyc create mode 100644 django_code/random_simpsons/__pycache__/apps.cpython-313.pyc delete mode 100644 django_code_new/dashboard/__pycache__/apps.cpython-312.pyc delete mode 100644 django_code_new/dashboard/apps.py delete mode 100644 django_code_new/db.sqlite3 delete mode 100644 django_code_new/django_code/__pycache__/__init__.cpython-312.pyc delete mode 100644 django_code_new/django_code/__pycache__/__init__.cpython-39.pyc delete mode 100644 django_code_new/django_code/__pycache__/settings.cpython-39.pyc delete mode 100644 django_code_new/django_code/__pycache__/urls.cpython-312.pyc delete mode 100644 django_code_new/django_code/asgi.py delete mode 100644 django_code_new/django_code/settings.py delete mode 100644 django_code_new/django_code/urls.py delete mode 100644 django_code_new/django_code/wsgi.py delete mode 100644 django_code_new/docker_connection/__pycache__/__init__.cpython-312.pyc delete mode 100644 django_code_new/docker_connection/__pycache__/apps.cpython-312.pyc delete mode 100644 django_code_new/docker_connection/apps.py delete mode 100644 django_code_new/docker_connection/migrations/__init__.py delete mode 100644 django_code_new/manage.py delete mode 100644 django_code_new/onenote/__pycache__/apps.cpython-312.pyc delete mode 100644 django_code_new/onenote/apps.py delete mode 100644 django_code_new/paperless_django/__pycache__/apps.cpython-312.pyc delete mode 100644 django_code_new/paperless_django/apps.py delete mode 100644 django_code_new/random_simpsons/__init__.py delete mode 100644 django_code_new/random_simpsons/__pycache__/__init__.cpython-312.pyc delete mode 100644 django_code_new/random_simpsons/__pycache__/apps.cpython-312.pyc delete mode 100644 django_code_new/random_simpsons/__pycache__/views.cpython-312.pyc delete mode 100644 django_code_new/random_simpsons/admin.py delete mode 100644 django_code_new/random_simpsons/apps.py delete mode 100644 django_code_new/random_simpsons/migrations/__init__.py delete mode 100644 django_code_new/random_simpsons/models.py delete mode 100644 django_code_new/random_simpsons/tests.py delete mode 100644 django_code_new/random_simpsons/views.py diff --git a/django_code/dashboard/__pycache__/apps.cpython-313.pyc b/django_code/dashboard/__pycache__/apps.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42ce838a2c9080356c262f6ffb2c979510913bf8 GIT binary patch literal 506 zcmX|;zfZzI6vyxAPbe4?2Z(XNfCCEzjT<2`E`%lwGCG*ro)iPU`mPK*x%vn2NATZ} zxD}h2IJueBKfrgT@RED?x$nF0yIwD?R7wQn{i{0t!}(h-_EE?o9U-j9giNSSMigj6 za=|W)6i_l&Y;~l8ma&SggPyTw8(`pG%{IZD=qCh|_M$i{6N7q7$ch6j(c>6*sn zVHAb8OoTiT42wFjz+-@90`q3T+-U4l>C8jHS&p=hX+`c1wF$k-xkcKA@oTN`_Xa~Y zpYw+22>*dQ;5ASJ6^+>60QS6OA`;Toh?`xPd#vj{Il+|Q?|5(PI$&qxB$*3v24Xk`C6y;Jq4WSY zUch0opm36TZ|2R*OlF_#6Z>OrNE)AuyW)FmhnpRNgupOUel=o7l$(3XD-%B1h~~kW zFLCnM%*$1m6ZQY2iHnMOaKuju)fr2m>?()phTv%t!Iv6NvV%}DnsLUcjh&Rm!b%-= zG;$Zs=ZFZcvB_8(h|yM8jHJX)iQSA-N1C{j7J3rv(Y9uSYw4gb-D2=~v&{6j@MX1p VE7pex{_yzt{^dXM@nC~n{smVmF17#w delta 295 zcmZusJx&5)5S{s0_m_{KWkD3BMk~%>JjHY*Z~d|xm0B9kU@UA%NNBgD@(lJIz?u_K zIjj^EPBQP!ym^_)R9ThTZ);=Hc-XC<_V4y~`AHxlFw8T*7%@zSa+5bIKH7-N=#S5_ zIyGgz>U^U9e>CyYkN}>9j&QMIiIjci*ewZx770RW;wXEF6_X7YjONO7EEZN;XrZ0^ z=qwT}wG7@ycQ>=C{uV!$vsX9Y SPWUU}!^cl}&xfsz#{3IZA2v(? diff --git a/django_code/django_code/__pycache__/urls.cpython-312.pyc b/django_code/django_code/__pycache__/urls.cpython-312.pyc index e53a372591ea43eb25b8fea582142903dc07f573..64485971473e3923a84dba9363194059e4ae0b36 100644 GIT binary patch delta 485 zcmX@f{e@5cG%qg~0}zNOE2jVAU|@I*;=lkel=1n*MD;+i6vh;m9IjlpC@w|@CWcg& z6xLMMEU}62Z@e3OOsNI@={Aui{q2?^YT)YOEUBG^fOX(a`N?Y z$>!y!q!#N}DPq@~l$e}dS`eR=pQK-lCXJB{?;=lkWl<`?-qIw_~6GJLX3TrBBmdM0D<;jkW z3XJR%*D14dq_TrV1KH|SAh8PmetwWerBa|t-_rz_KOhO-PDJY7ps$}v>_R=cdNknh1% z_3H;;V2k-Jr`_cwbeNA@jAQ$V_-$rd%%(Wt?1);SuBu;kD1O}KZa~72a$h{gt|LOs zSvRBtLnMJihQD#>Q=#L#5XNJiV#kMw-XwP5QX(i8l-5-YS0@YuQ8x^mSwf#AP19M- zGpKJ|)2|vK3mi)rl59YFVW@Y$B_6~Qb@gu7w_@3G+BoPH9e-}ynE2T70>;BS#x2e~ z>>ZmV2$IQ(%$R>Q;mZnS0p}`&tx#;ITB&R$b#<6Wx3EtJ$3qN%rBBE)tR3bW5e z{WldX>`*R+=&|Bd&OM0rf7D36PJ}6gRJFe;y6;X-3P5;UFjEPLnTyFVWJuQ{al6DRbi6%rjFzcuvkvJuoLbqI}{(RQ#*> z=$$vpigK}SQ6UW(m1Z1{a&h62I;}7&PjOsIv~=#R`4OFgCKP>S$Pb7y5fpz+X0Yrm zJvfdEpLxvgy7VTOUv>D$An^;_UM*xYnbT}Jqx^wUW^;_ze?zq~x;{o9j!|Wdc26&$ zT=ChZ=ewhe)xpK;P|pEFy1 m{nki780ZH><;$3JrC+-@sy!Uk9uAd9uMAwyez(NsFYZs$!xWPM literal 0 HcmV?d00001 diff --git a/django_code_new/django_code/__pycache__/wsgi.cpython-312.pyc b/django_code/django_code/__pycache__/wsgi.cpython-313.pyc similarity index 60% rename from django_code_new/django_code/__pycache__/wsgi.cpython-312.pyc rename to django_code/django_code/__pycache__/wsgi.cpython-313.pyc index afc81f390084b1cffb046f303be38b09b4b88774..4c20920af85f9baf366d119dcf671f1ef64e11ec 100644 GIT binary patch delta 123 zcmeyx@{5J>^F&6?#HkFy3`GpVjKNIaj75w^h8F@#OVwv3{eazj44bxj8Tk0nmLClmpO`=ks*~ai-Q3JWN~8%F{H4h lu&!o;h%+)UF{CoDhAN6;tK8UK&B*v`GCPwRkkn)H0RYi16Al0X diff --git a/django_code/django_code/settings.py b/django_code/django_code/settings.py index 435f205..a2477ef 100644 --- a/django_code/django_code/settings.py +++ b/django_code/django_code/settings.py @@ -121,3 +121,4 @@ STATIC_URL = 'static/' # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +# diff --git a/django_code/django_code/urls.py b/django_code/django_code/urls.py index 5ee9bfc..83f261b 100644 --- a/django_code/django_code/urls.py +++ b/django_code/django_code/urls.py @@ -21,6 +21,7 @@ from random_simpsons import apps as random_simpsons from paperless_django import apps as paperless_django from onenote import apps as onenote from dashboard import apps as dashboard +from kubernetes_connection import apps as kubernetes_connection urlpatterns = [ # path('admin/', admin.site.urls), @@ -41,6 +42,12 @@ urlpatterns = [ path('dashboard/hello/', dashboard.hello), +################## kubernetes_connection##### + path('kubernetes_connection/hello/', kubernetes_connection.hello), + path('kubernetes_connection/nodes/', kubernetes_connection.nodes), + path('kubernetes_connection/backup_job/', kubernetes_connection.backup_job), + path('kubernetes_connection/backup_job_yaml/', kubernetes_connection.backup_job_yaml), + # path('bookstack/', docker_connection.apps.hello), # path('test/', docker_connection.apps.http_call_test), # path('proxmox/', docker_connection.apps.proxmox), diff --git a/django_code_new/django_code/__init__.py b/django_code/kubernetes_connection/__init__.py similarity index 100% rename from django_code_new/django_code/__init__.py rename to django_code/kubernetes_connection/__init__.py diff --git a/django_code/kubernetes_connection/__pycache__/__init__.cpython-312.pyc b/django_code/kubernetes_connection/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..856820b897669acb6f4417dabe21f285c348d03a GIT binary patch literal 148 zcmX@j%ge<81gnG<(?RrO5P=Rpvj9b=GgLBYGWxA#C}INgK7-W!GS*MdPf68J$x6&i z&yNSQvrCgwi}F%SQj3B7yu8%plFa-({rLFIyv&mLc)fzkUmP~M`6;D2sdh!IKr>P{wB#AY&>+I)f&o-%5reCLr%KNa~icesX?Fs(wmV zVqSWFJeZwbnv`0Ums*lq4CLqKr6!kT=I80h$7kkcmc+;F6;$5hu*uC&Da}c>D`Ewj T0kWeQ#Q4a}$jDg43}gWS8M-3b literal 0 HcmV?d00001 diff --git a/django_code/kubernetes_connection/__pycache__/apps.cpython-312.pyc b/django_code/kubernetes_connection/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10af6a1d6eaa1566f4a1d44989815183aa721d2a GIT binary patch literal 3047 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 HBh>#R<|Dvc literal 0 HcmV?d00001 diff --git a/django_code_new/docker_connection/__pycache__/views.cpython-312.pyc b/django_code/kubernetes_connection/__pycache__/views.cpython-312.pyc similarity index 100% rename from django_code_new/docker_connection/__pycache__/views.cpython-312.pyc rename to django_code/kubernetes_connection/__pycache__/views.cpython-312.pyc diff --git a/django_code_new/docker_connection/admin.py b/django_code/kubernetes_connection/admin.py similarity index 100% rename from django_code_new/docker_connection/admin.py rename to django_code/kubernetes_connection/admin.py diff --git a/django_code/kubernetes_connection/apps.py b/django_code/kubernetes_connection/apps.py new file mode 100644 index 0000000..32345cc --- /dev/null +++ b/django_code/kubernetes_connection/apps.py @@ -0,0 +1,115 @@ +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 kubernetes import client, config + +#from django.template.loader import render_to_string +import time +import random +import mimetypes +import ruamel.yaml +import yaml +def hello(request): + return HttpResponse('

Hello k8s!

') + + +def nodes(request): + config.load_kube_config(config_file='/code/kubeconfig') + v1 = client.CoreV1Api() +# v1.list_node() + pod_manifest = { + 'apiVersion': 'v1', + 'kind': 'Pod', + 'metadata': { + 'labels': { + 'bot': 'current-bot' + }, + 'name': 'podname', + 'namespace': 'echo-server' + + }, + 'spec': { + + 'containers': [{ + 'image': 'gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1', +# 'pod-running-timeout': '5m0s', + 'name': 'testpython', + 'env': [ + {'name': 'env_variable', 'value': 'env_value'}, + ] + }], + 'restartPolicy': 'Always', +# 'serviceAccountName': 'bots-service-account' + } + } + +# print(f'POD MANIFEST:\n{pod_manifest}') + api_response = v1.create_namespaced_pod(body=pod_manifest,namespace='echo-server') + return HttpResponse(api_response) + +def backup_job(request): + config.load_kube_config(config_file='/code/kubeconfig') + v1 = client.CoreV1Api() + #v1 = client.BatchV1Api() +# v1.list_node() + pod_manifest_job = { + 'apiVersion': 'batch/v1', + 'kind': 'Job', + 'metadata': { + 'name': 'bitwarden-backup-django', + 'namespace': 'bwbackup' + + }, + 'spec': { + 'template': { + 'spec': { + + 'containers': [{ + 'image': 'gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1', + 'name': 'testpython', + 'command': ['/bin/sh -c /config/export_bitwarden.sh'], + 'env': [ + {'name': 'env_variable', 'value': 'env_value'}, + ], + 'volumeMounts': [ + {'name': 'scripts', 'configMap': [{'name':'bitwarden-export-scripts'},]}, + ] + }], + 'restartPolicy': 'Always', + } + } + } + } + + api_response = v1.create_namespaced_job(body=pod_manifest_job) + return HttpResponse(api_response) + + +#help with yaml import +#https://github.com/kubernetes-client/python/issues/589 + +def backup_job_yaml(request): + config.load_kube_config(config_file='/code/kubeconfig') +# v1 = client.CoreV1Api() + v1 = client.BatchV1Api() + +# v1.list_node() +# pod_manifest_job = { + + with open('/code/pod.yaml') as fo: +# yaml = YAML(typ='rt') + #yaml.load(...) + +# job = ruamel.yaml.load(fo) + job = yaml.safe_load(fo) + + v1.create_namespaced_job( + job['metadata']['namespace'], job, pretty=True + +# _request_timeout=(settings.CONNECTION_TIMEOUT_SECONDS, settings.READ_TIMEOUT_SECONDS + +) + return HttpResponse(job['metadata']['namespace']) diff --git a/django_code_new/docker_connection/__init__.py b/django_code/kubernetes_connection/migrations/__init__.py similarity index 100% rename from django_code_new/docker_connection/__init__.py rename to django_code/kubernetes_connection/migrations/__init__.py diff --git a/django_code_new/docker_connection/models.py b/django_code/kubernetes_connection/models.py similarity index 100% rename from django_code_new/docker_connection/models.py rename to django_code/kubernetes_connection/models.py diff --git a/django_code_new/random_simpsons/templates/my_template.html b/django_code/kubernetes_connection/templates/my_template.html similarity index 100% rename from django_code_new/random_simpsons/templates/my_template.html rename to django_code/kubernetes_connection/templates/my_template.html diff --git a/django_code_new/docker_connection/tests.py b/django_code/kubernetes_connection/tests.py similarity index 100% rename from django_code_new/docker_connection/tests.py rename to django_code/kubernetes_connection/tests.py diff --git a/django_code_new/docker_connection/views.py b/django_code/kubernetes_connection/views.py similarity index 100% rename from django_code_new/docker_connection/views.py rename to django_code/kubernetes_connection/views.py diff --git a/django_code/onenote/__pycache__/apps.cpython-313.pyc b/django_code/onenote/__pycache__/apps.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..184918d3cc739a3fce095e7bc6e714f8450329f1 GIT binary patch literal 504 zcmX|;&rZTX5XN`uUnm$74-n%4A|ALvz<47h#tUf;2Yd8j2whtYbn9$6=*gGhA$S`S zZ^g!gCvPV80i3OsNp|+P-^@4Nwpp!KAs9Cwb^izVPkH!{QURHbupusSsY7fEv?aOZ zlxzi*oE1m4HPCWak#*2>)*J&2?A06-Ojkc4Q1-R1@g)a$X;Qw5qH7*LEc`7^s*^a5 zZkdR9C>R!XV4=qV$pq#tfX(CSoJwaA3hr`cO-vhdcc{7avfvKsmZmR_Q7{-!*mB8R zJY*q{S-T}AP|=9<4PZ}eCSoC7t)$(bbC31C$64s}`M%ovbSsJVH>M|@Aa8q60(@Q2q*5<>M8F}QuVVo^%3#Qv8ZTB1 zzr`%{_$q(kmOxdO<$p`e(TaQPB^$#r9_9VTDW-3QQks%>N;)YyOUe13SbI{-R7x*$ F_b;A+cdY;b literal 0 HcmV?d00001 diff --git a/django_code/paperless_django/__pycache__/apps.cpython-313.pyc b/django_code/paperless_django/__pycache__/apps.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b4a4b4dee032b8e99127915aa2e8b6afeacb693 GIT binary patch literal 789 zcmY*XPiqrF6raid$)?-17Q{vmvcZ;iJ!C0uFIozshnheUgQpzAlAUB%HoNPa*+V_` z*e_5J_29MNCQwh?1_Zr$Qp^|d%_QB@2lM#N`!~P$=FRH$C4#d1=iBfzCFG~P+(=~s zW^WLjlP>Af4rx=Mj>MHtrLBRcu-4Jr1{ezKh)pmRHab6N}N-Cy7h;#Q77K0F9_4v$zIr%vW)3}VK4(~(BdF%@5^0{f6NF1XBdil^Qn4VV|a z_mffDSGY{<&#j)HWxSQ06hXzN%wHkE z@zR9evVT{ycSui0De1`^CAa>&U2cXrKmN?~N~$dZCn8N+BgVjIAX+TLMC5Tns-6(yqCbCiR!OLDV>t$lx$4NlPTG} TBK8%j|I;bmpP2^TRwe!e@AtM+ literal 0 HcmV?d00001 diff --git a/django_code/random_simpsons/__pycache__/__init__.cpython-313.pyc b/django_code/random_simpsons/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f0d463e3fdad61176c854ab4e438ae97136ae9f6 GIT binary patch literal 142 zcmey&%ge<81WwoHr-A6lAOZ#$p^VQgK*m&tbOudEzm*I{OhDdekkl<*{p9?VRQ;5! z#Ju$Ucrd#tF)t-QH@-MCx1cybuUJ1mJ~J<~BtBlRpz;=nO>TZlX-=wL5i3wP$n;_m O<0CU8BV!RWkOcsZc_Bam literal 0 HcmV?d00001 diff --git a/django_code/random_simpsons/__pycache__/apps.cpython-313.pyc b/django_code/random_simpsons/__pycache__/apps.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2af6b2895257803efc43bca473043913a195aa42 GIT binary patch literal 2753 zcmaJDOK%fLc-CG!>-dp`B#=;)ZW16^)Vm=#P-vja3-W*fUffbes@d3Myp6rPon2F6 zgycgHQ4bYWg<7>p&4B~ldg!6YR_YJ1Wu!(+B2|JOd_x5F+;7&qPD~#o%{SkE^F3zf zd+km*+>T)U_2q$E&jScOryuU{ILM9;$O9xHiCIJo3}JYRdlo$lUgEWJ?;^Y4BR(5v z0rwNXjr$hc7C6G$xPLJ~0wCvKY$xsZ8YDrf?I0o{i31px0stdYJHU=x{%EjH%|{t4 zFsbX)nwnK^Jz=cSoN4L_Z0MS5VA%8%tY$C)j3YRs5S%svXD=vuyp(3B24{F-rE{kb zzyq}0+>@Ab2S1FWo~2UXMDE1-Ih@aHyrdL#0}KsLh(IGONP_Y!Z3{pfHK+&9;oz<)q*E0?8zOV zpq6t}qxQL%00Ad3DkFJR&z|#pC3f6#mFiuly!J?X-FvC*vd^VTK9>r&^)Hor#f)sq zVn+K+&1-T-gzL(LlqRp|urQ^q8N%4;i8F#U8lN2<7sgJU8r6llnZ$|FtNEfKd^kIm zP;}wc^qg>K?9{k0H~YbK?5Z>=6jpDSCK{Soiz}F@*u;i7C8t-5x~SqiW;(AGGoq?d z^4REDJT`hdHukPKtrdxZg+j(+Na>4RN4UppID*nAWIji5_T0$byZq(Znfb|7GI5E& zcMm=tPh=qk1cLLjsocgXT{d&DJ#zjH230O#pihYMdE3cU_sSaPTP;St7OUx4B^$RNmGlB_A57ycfHL|c za-@85vm;TSdmTYty_H_6lDtvt{HQ#?wQv9ZwXenUBE-#0g!-`uf+m#p0Pf3r2o0>X zo4J4^KTJD-)&YUQr!;#c_HwzjW}r9(Sdz^Ifv{_H>B~?p8YAg}6moRA!KHeW5T+7h zk;+QmBpUME=A2NDt?c5pYU9%8xr2csu`P6Ak_`UR5Uf} zvpkw%vDB3`+vU8Cg)YELyA^?Sf6wB? z20-tlhoeoc`+c@7=@I?%|D@T6eU3X{+O{hcg?89-Fm8@mj}td2X|_=l-?( ziThl6e)H&=pXaMbXUlVy@KBW<-VAn^uQZ(GR2@)@5REI_NuL9CH_JsNd9N{$)ix6a z|K_wIB(X`4>w?y7-*s4$b)7?<;o>~nQycud+&AJ98-oa^4svr$(gB(sO7R?z?;tpn;`QJO{nT zI4g>)ieaQ>VrrTyn3^tPT`_3QH*+}V7WtTgWhkDp`Y@a-I$RIKQr}MjZ8+qJ3+nw8 zqj|6k>Ia&;v<&PrH?U|6t=>aFZQ8MxjW@-bCjXzgPODCx24ktS(YW}=RgANI>2N{5 zqZEn-Ud!^%t@*4*cr&LM4jXW}at;Sj0x<`VLDu>kYN2sLUsP1n^67*wUc)4W7L;gP zqnL)=$4nJT-s)0|1?U|qEt_%tQth7T&ne7Uyr=_r>>WN)I0d7d*kEUV7%HB|8ce2Gx^)_FKTTnS?x)#2f+Ng z@|5d?lXdnz^nN@4eWcbgQsGAIA`|U&dyqhXLI|xfO$rTfyO~*?jXot9IgOalxlZ9Zla)N zig|pVybm-Qbw(V(OE1GP+h}kb9o|O6+vv!jXlTcen9ws6eug?v1t Nre|k=A9Kvs`ZoeogdhL_ literal 0 HcmV?d00001 diff --git a/django_code_new/dashboard/__pycache__/apps.cpython-312.pyc b/django_code_new/dashboard/__pycache__/apps.cpython-312.pyc deleted file mode 100644 index 261f91796a196b100d5ddb08f92028f9c9eee07e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/django_code_new/dashboard/apps.py b/django_code_new/dashboard/apps.py deleted file mode 100644 index 4e31abe..0000000 --- a/django_code_new/dashboard/apps.py +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index e69de29..0000000 diff --git a/django_code_new/django_code/__pycache__/__init__.cpython-312.pyc b/django_code_new/django_code/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 879bacb2620408bf3ef27dd4fcf1d6a7c3f714fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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!IzoJq0tUQ!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#{| diff --git a/django_code_new/django_code/__pycache__/urls.cpython-312.pyc b/django_code_new/django_code/__pycache__/urls.cpython-312.pyc deleted file mode 100644 index e53a372591ea43eb25b8fea582142903dc07f573..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/django_code_new/django_code/asgi.py b/django_code_new/django_code/asgi.py deleted file mode 100644 index 61e223c..0000000 --- a/django_code_new/django_code/asgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -ASGI config for django_code project. - -It exposes the ASGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ -""" - -import os - -from django.core.asgi import get_asgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_code.settings') - -application = get_asgi_application() diff --git a/django_code_new/django_code/settings.py b/django_code_new/django_code/settings.py deleted file mode 100644 index 435f205..0000000 --- a/django_code_new/django_code/settings.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -Django settings for django_code project. - -Generated by 'django-admin startproject' using Django 4.2.5. - -For more information on this file, see -https://docs.djangoproject.com/en/4.2/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/4.2/ref/settings/ -""" - -from pathlib import Path - -# Build paths inside the project like this: BASE_DIR / 'subdir'. -BASE_DIR = Path(__file__).resolve().parent.parent - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-71%)_#e#o9-dl2o^6mfud-*rw+4+8vy-nd*bzeier&(34ap-p9' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = ['reverse.tryton.geeraert.eu','192.168.4.100','django.tryton.geeraert.eu'] - - -# Application definition - -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'django_code.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'django_code.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/4.2/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', - } -} - - -# Password validation -# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/4.2/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/4.2/howto/static-files/ - -STATIC_URL = 'static/' - -# Default primary key field type -# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field - -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/django_code_new/django_code/urls.py b/django_code_new/django_code/urls.py deleted file mode 100644 index 5ee9bfc..0000000 --- a/django_code_new/django_code/urls.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -URL configuration for django_code project. - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/4.2/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" -from django.contrib import admin -from django.urls import path -#from docker_connection import views, apps -from random_simpsons import apps as random_simpsons -from paperless_django import apps as paperless_django -from onenote import apps as onenote -from dashboard import apps as dashboard - -urlpatterns = [ -# path('admin/', admin.site.urls), - -################### Simpsons ################### - path('hello/', random_simpsons.hello), - path('simpsons/', random_simpsons.simpsons), - path('download_file/', random_simpsons.download_file), - -################### paperless ################### - path('paperless/hello/', paperless_django.hello), -# path('simpsons/', random_simpsons.simpsons), - -################### onenote ################### - path('onenote/hello/', onenote.hello), - -################### onenote ################### - path('dashboard/hello/', dashboard.hello), - - -# path('bookstack/', docker_connection.apps.hello), -# path('test/', docker_connection.apps.http_call_test), -# path('proxmox/', docker_connection.apps.proxmox), -# path('simpsons/', random_simpsons.hello), - # path('docker//', docker_connection.apps.docker_call), - - -] diff --git a/django_code_new/django_code/wsgi.py b/django_code_new/django_code/wsgi.py deleted file mode 100644 index 7a52be5..0000000 --- a/django_code_new/django_code/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -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/__pycache__/__init__.cpython-312.pyc b/django_code_new/docker_connection/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 7e5ff04a8f233f35f99a89ea3fc2f3422179a67f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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{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 deleted file mode 100644 index e69de29..0000000 diff --git a/django_code_new/manage.py b/django_code_new/manage.py deleted file mode 100644 index 9a915ed..0000000 --- a/django_code_new/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 deleted file mode 100644 index c91f9a37d575138a2196c21390a48613940265bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 deleted file mode 100644 index 350d9eb53ef106aab3d7d7cc5339a045726323f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 deleted file mode 100644 index e69de29..0000000 diff --git a/django_code_new/random_simpsons/__pycache__/__init__.cpython-312.pyc b/django_code_new/random_simpsons/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 0cd810f9dd56bede14764475368b29924c1d1833..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 142 zcmX@j%ge<81WwoHr-A6lAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxdrK_KupOUJdl9ia3 zo*xfp7bWJUlIY~;;_lhPbtkwwJTx;>ShGuVi4ma MGb1Bo5i^hl0F2}zYXATM diff --git a/django_code_new/random_simpsons/__pycache__/apps.cpython-312.pyc b/django_code_new/random_simpsons/__pycache__/apps.cpython-312.pyc deleted file mode 100644 index f93589b95de010fd156278377c7f7831a33403e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/django_code_new/random_simpsons/__pycache__/views.cpython-312.pyc b/django_code_new/random_simpsons/__pycache__/views.cpython-312.pyc deleted file mode 100644 index e6faa35c550f1ff56632582cd565e53dc569630f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/django_code_new/random_simpsons/admin.py b/django_code_new/random_simpsons/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/django_code_new/random_simpsons/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 59c6272..0000000 --- a/django_code_new/random_simpsons/apps.py +++ /dev/null @@ -1,68 +0,0 @@ -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 deleted file mode 100644 index e69de29..0000000 diff --git a/django_code_new/random_simpsons/models.py b/django_code_new/random_simpsons/models.py deleted file mode 100644 index 71a8362..0000000 --- a/django_code_new/random_simpsons/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/django_code_new/random_simpsons/tests.py b/django_code_new/random_simpsons/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/django_code_new/random_simpsons/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index dcf84f6..0000000 --- a/django_code_new/random_simpsons/views.py +++ /dev/null @@ -1,8 +0,0 @@ -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!

')