💥 rename everything to match django_code instead
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -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.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -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>')
|
||||
Reference in New Issue
Block a user