base setup
This commit is contained in:
19
at_django_boilerplate/accounts/management/commands/seed_admin_account.py
Executable file
19
at_django_boilerplate/accounts/management/commands/seed_admin_account.py
Executable file
@@ -0,0 +1,19 @@
|
||||
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"))
|
||||
Reference in New Issue
Block a user