Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

fix: Correct db import in template_service

Juan Denis2701a491405f
diff --git a/backend/app/services/template_service.py b/backend/app/services/template_service.py
index 40baf52a..af22f1ee 100644
--- a/backend/app/services/template_service.py
+++ b/backend/app/services/template_service.py
@@ -320,7 +320,8 @@ class TemplateService:
def install_template(cls, template_id: str, app_name: str,
user_variables: Dict = None, user_id: int = None) -> Dict:
"""Install a template as a new application."""
- from app.models import Application, db
+ from app import db
+ from app.models import Application
from app.services.docker_service import DockerService
# Get template
@@ -509,7 +510,8 @@ class TemplateService:
@classmethod
def update_app(cls, app_id: int, user_id: int = None) -> Dict:
"""Update an installed app to the latest template version."""
- from app.models import Application, db
+ from app import db
+ from app.models import Application
from app.services.docker_service import DockerService
config = cls.get_config()