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
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -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('import_namespace', import_namespace_view, 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),
|
||||
|
||||
################### 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),
|
||||
|
||||
]
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user