change the way it work to fix import_namespace() takes 0 positional arguments but 1 was given
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s

This commit is contained in:
pierre geeraert
2026-09-10 21:36:02 +01:00
parent 90156a4733
commit cc3394d5eb
2 changed files with 10 additions and 17 deletions
+4 -15
View File
@@ -15,27 +15,16 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.urls import path
from apps.cloudmanager import apps as cloudmanager_apps
from apps.cloudmanager.views import coucou,display,hello
from .utils import import_namespace
from .views import coucou,display,hello,import_namespace_view
urlpatterns = [
################### cloudmanager ###################
path('', hello, name='hello'),
path('coucou', coucou, name='coucou'),
path('display', display, name='display'),
path('import_namespace', import_namespace, name='import_namespace'),
#path('/run-action/', cloudmanager_views.trigger_my_action, name='run_my_action_url'),
#path('change-schedule/', cloudmanager_views.change_schedule, name='change_schedule'),
#path('/main/', db_interaction.main),
path('import_namespace', import_namespace_view, name='import_namespace'),
################### onenote ###################
#path('dashboard/', dashboardapp.hello),
#path('view/about', dashboardview.about),
#path('view/home', dashboardview.home),
#path('view/success', dashboardview.success),
#path('scale_up/<str:namespace_name>/<str:deploy_name>', dashboardview.scale_up),
#path('scale_down/<str:namespace_name>/<str:deploy_name>', dashboardview.scale_down),
]
+6 -2
View File
@@ -2,8 +2,9 @@ from django.http import HttpResponse
from django.shortcuts import render
# IMPORT AT THE TOP HERE: This is completely safe!
from apps.cloudmanager.models import Deployment_Data,Schedule_Week_Data
from apps.cloudmanager.db_interaction import DB_generation,Check_server_supposed_XXX,Give_current_weekday,Give_current_hour
from .models import Deployment_Data,Schedule_Week_Data
from .db_interaction import DB_generation,Check_server_supposed_XXX,Give_current_weekday,Give_current_hour
from .utils import import_namespace
def coucou(request):
# 1. Prepare the data inside the function
@@ -30,6 +31,9 @@ def hello(request):
list_servers_up = [['wiki', 'wikijs', 2], ['book', 'bookstack-db', 1]]
return render(request, 'cloudmanager/index.html', {'list_schedule':list_schedule,'list_servers_up':list_servers_up})
def import_namespace_view(request):
import_namespace()
def redirect(request):
db_host = os.environ.get('DB_HOST')
db_port = os.environ.get('DB_PORT')