Files
B42/at_django_boilerplate/accounts/management/commands/seed_admin_account.py
2026-01-07 12:09:20 +05:30

20 lines
620 B
Python
Executable File

from django.core.management.base import BaseCommand
from at_django_boilerplate.accounts.models import CustomUser
from django.db.utils import IntegrityError
class Command(BaseCommand):
help = 'Add predefined tags to the database'
def handle(self, *args, **kwargs):
tmp = CustomUser.objects.create(email='admin@rys.com',first_name='Admin',last_name='User')
tmp.save()
tmp.set_password('1234')
tmp.is_superuser = True
tmp.is_active = True
tmp.is_staff = True
tmp.save()
self.stdout.write(self.style.SUCCESS("✅ Seeded Accounts & Businesses"))