Files
Django_kube/django_code/apps/cloudmanager/views.py
T
pi-ux-ce ef7b47b0c5
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Try to start a deploy using admin interface
2026-06-18 17:26:50 +01:00

26 lines
657 B
Python

from django.http import HttpResponse
# IMPORT AT THE TOP HERE: This is completely safe!
from apps.cloudmanager.models import Machine_Data,Schedule_Week_Data
def coucou(request):
# 1. Prepare the data inside the function
data = CmmData(
name="test",
namespace="testspace",
schedule_hour="1",
schedule_day="deux",
replicas=3
)
# 2. This line actually pushes the data into your cloudmanager_db!
data.save()
return HttpResponse('<h1>Hello cmm! Data saved successfully!</h1>')
def display(request):
data = CmmData.objects.all()
print(data[0].namespace)
return HttpResponse(data)