diff --git a/wireguard_tools/migrations/0001_initial.py b/wireguard_tools/migrations/0001_initial.py new file mode 100644 index 0000000..dc88a04 --- /dev/null +++ b/wireguard_tools/migrations/0001_initial.py @@ -0,0 +1,31 @@ +# Generated by Django 5.1.5 on 2025-02-25 12:21 + +import uuid +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='EmailSettings', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(default='email_settings', max_length=20, unique=True)), + ('smtp_username', models.CharField(blank=True, max_length=100, null=True)), + ('smtp_password', models.CharField(blank=True, max_length=100, null=True)), + ('smtp_host', models.CharField(blank=True, max_length=100, null=True)), + ('smtp_port', models.IntegerField(default=587)), + ('smtp_encryption', models.CharField(choices=[('ssl', 'SSL'), ('tls', 'TLS')], default='tls', max_length=3)), + ('smtp_from_address', models.EmailField(blank=True, max_length=254, null=True)), + ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)), + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), + ], + ), + ] diff --git a/wireguard_tools/models.py b/wireguard_tools/models.py index 71a8362..3239918 100644 --- a/wireguard_tools/models.py +++ b/wireguard_tools/models.py @@ -1,3 +1,16 @@ from django.db import models +import uuid -# Create your models here. + +class EmailSettings(models.Model): + name = models.CharField(default='email_settings', max_length=20, unique=True) + smtp_username = models.CharField(max_length=100, blank=True, null=True) + smtp_password = models.CharField(max_length=100, blank=True, null=True) + smtp_host = models.CharField(max_length=100, blank=True, null=True) + smtp_port = models.IntegerField(default=587) + smtp_encryption = models.CharField(default='tls', choices=(('ssl', 'SSL'), ('tls', 'TLS')), max_length=3) + smtp_from_address = models.EmailField(blank=True, null=True) + + uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) + created = models.DateTimeField(auto_now_add=True) + updated = models.DateTimeField(auto_now=True)