💥 add all the files

This commit is contained in:
2024-07-23 16:28:04 +01:00
parent 4fa0fe6fc1
commit d71c9505e7
101 changed files with 1158 additions and 153 deletions
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+46
View File
@@ -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('<h1>Start bookstack!</h1>')
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)
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+8
View File
@@ -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('<h1>Hello Django!</h1>')