20 lines
591 B
Python
20 lines
591 B
Python
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),
|
||
] |