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

20 lines
591 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.db import migrations
def create_default_ssh_credential(apps, schema_editor):
SSHCredential = apps.get_model('ssh_manager', 'SSHCredential')
if not SSHCredential.objects.exists():
SSHCredential.objects.create(
hostname='localhost', # Varsayılan sunucu bilgileri
username='root',
password='password',
port=22
)
class Migration(migrations.Migration):
dependencies = [
('ssh_manager', '0001_initial'),
]
operations = [
migrations.RunPython(create_default_ssh_credential),
]