Files
hostpanel/ssh_manager/middleware.py
ilkeral 342f1314c7 yeni
2025-07-21 13:49:36 +03:00

11 lines
471 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from django.utils.deprecation import MiddlewareMixin
class SSHConnectionMiddleware(MiddlewareMixin):
_connection_checked = False # Sınıf değişkeni olarak tanımla
def process_request(self, request):
# Sadece bir kez çalıştır
if not SSHConnectionMiddleware._connection_checked:
from .apps import check_server_connection
check_server_connection()
SSHConnectionMiddleware._connection_checked = True