barebone app with django and react, sse, jwt token, comport reader, test comport writer, requires com0com, users with groups, sample table vehicles, tokens for access and refresh

This commit is contained in:
2026-01-17 13:03:21 +02:00
commit 7f04566242
81 changed files with 22551 additions and 0 deletions
@@ -0,0 +1,34 @@
from django.core.management.base import BaseCommand
from api.models import User
class Command(BaseCommand):
help = 'Creates predefined admin user (username: admin, password: admin)'
def handle(self, *args, **options):
username = 'admin'
password = 'admin'
if User.objects.filter(username=username).exists():
self.stdout.write(
self.style.WARNING(f'User "{username}" already exists')
)
return
user = User.objects.create(
username=username,
email='admin@scalesapp.com',
role='employee',
is_admin=True,
is_staff=True,
is_superuser=True,
is_active=True
)
user.set_password(password)
user.save()
self.stdout.write(
self.style.SUCCESS(
f'Successfully created admin user: {username} / {password}'
)
)