yeni
This commit is contained in:
20
ssh_manager/migrations/0002_default_ssh_credential.py
Normal file
20
ssh_manager/migrations/0002_default_ssh_credential.py
Normal file
@ -0,0 +1,20 @@
|
||||
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),
|
||||
]
|
||||
Reference in New Issue
Block a user