from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from toefl_prep_app.models import UserProfile

class Command(BaseCommand):
    help = 'Seed user data'

    def handle(self, *args, **kwargs):
        # Check if there are existing users
        if User.objects.exists():
            self.stdout.write(self.style.WARNING('Users already exist. Aborting...'))
            return

        # Create users and associated user profiles
        self.stdout.write('Seeding users...')
        users_data = [
            {'username':'abdillahtaufiq.osh@gmail.com', 'password': 'XjeO5934*', 'email': 'abdillahtaufiq.osh@gmail.com'},
            {'username':'adilyudhap.osh@gmail.com', 'password': 'ZpvK6971*', 'email': 'adilyudhap.osh@gmail.com'},
            {'username':'adindagita.osh@gmail.com', 'password': 'SwaY6865*', 'email': 'adindagita.osh@gmail.com'},
            {'username':'adzkiansiqhny.osh@gmail.com', 'password': 'IexU3239+', 'email': 'adzkiansiqhny.osh@gmail.com'},
            {'username':'aghniamauriska.osh@gmail.com', 'password': 'YhdT7489*', 'email': 'aghniamauriska.osh@gmail.com'},
            {'username':'ahdaamelia.osh@gmail.com', 'password': 'BpnG5865*', 'email': 'ahdaamelia.osh@gmail.com'},
            {'username':'ainizahramazaya.osh@gmail.com', 'password': 'UpjD2988*', 'email': 'ainizahramazaya.osh@gmail.com'},
            {'username':'anasya.osh@gmail.com', 'password': 'DczG1696*', 'email': 'anasya.osh@gmail.com'},
            {'username':'andiniputri.osh@gmail.com', 'password': 'BhhF6017+', 'email': 'andiniputri.osh@gmail.com'},
            {'username':'angelaresa.osh@gmail.com', 'password': 'BgcL5405+', 'email': 'angelaresa.osh@gmail.com'},
            {'username':'anggiashayla.osh@gmail.com', 'password': 'WweJ9361*', 'email': 'anggiashayla.osh@gmail.com'},
            {'username':'arinayun.osh@gmail.com', 'password': 'ItgW4123*', 'email': 'arinayun.osh@gmail.com'},
            {'username':'aryafikran.osh@gmail.com', 'password': 'NtuZ5317*', 'email': 'aryafikran.osh@gmail.com'},
            {'username':'ayunaberliana.osh@gmail.com', 'password': 'XoyE8451+', 'email': 'ayunaberliana.osh@gmail.com'},
            {'username':'ayundanirmala.osh@gmail.com', 'password': 'BmqC3619+', 'email': 'ayundanirmala.osh@gmail.com'},
            {'username':'azzahrachantika.osh@gmail.com', 'password': 'AwzT8215+', 'email': 'azzahrachantika.osh@gmail.com'},
            {'username':'bedriarda.osh@gmail.com', 'password': 'SsjL8192+', 'email': 'bedriarda.osh@gmail.com'},
            {'username':'bernadettanovi.osh@gmail.com', 'password': 'QvdN5160*', 'email': 'bernadettanovi.osh@gmail.com'},
            {'username':'chrysanthiarum.osh@gmail.com', 'password': 'BchE5443+', 'email': 'chrysanthiarum.osh@gmail.com'},
            {'username':'corinadani.osh@gmail.com', 'password': 'JteY9059*', 'email': 'corinadani.osh@gmail.com'},
            {'username':'deaseptiyani.osh@gmail.com', 'password': 'XnlB3216+', 'email': 'deaseptiyani.osh@gmail.com'},
            {'username':'deviatuzahra.osh@gmail.com', 'password': 'RivE9496*', 'email': 'deviatuzahra.osh@gmail.com'},
            {'username':'dimasputrap.osh@gmail.com', 'password': 'QekT3901*', 'email': 'dimasputrap.osh@gmail.com'},
            {'username':'dindaamandha.osh@gmail.com', 'password': 'MlvM4788+', 'email': 'dindaamandha.osh@gmail.com'},
            {'username':'dwiahmad.osh@gmail.com', 'password': 'EuqQ1526*', 'email': 'dwiahmad.osh@gmail.com'},
            {'username':'dwywahyuni.osh@gmail.com', 'password': 'LbsC2241+', 'email': 'dwywahyuni.osh@gmail.com'},
            {'username':'erlayunita.osh@gmail.com', 'password': 'IjgO3981*', 'email': 'erlayunita.osh@gmail.com'},
            {'username':'fadilarahma.osh@gmail.com', 'password': 'UvbQ4071+', 'email': 'fadilarahma.osh@gmail.com'},
            {'username':'fahfahreziosh@gmail.com', 'password': 'SnvD3790*', 'email': 'fahfahreziosh@gmail.com'},
            {'username':'faricafortunata.osh@gmail.com', 'password': 'HmgC9989*', 'email': 'faricafortunata.osh@gmail.com'},
            {'username':'fatmarosda.osh@gmail.com', 'password': 'KbcW6098*', 'email': 'fatmarosda.osh@gmail.com'},
            {'username':'fawwazt.osh@gmail.com', 'password': 'EiyK9533*', 'email': 'fawwazt.osh@gmail.com'},
            {'username':'fayzaanindya.osh@gmail.com', 'password': 'QknX4761+', 'email': 'fayzaanindya.osh@gmail.com'},
            {'username':'fridaqaida.osh@gmail.com', 'password': 'IvdH2822*', 'email': 'fridaqaida.osh@gmail.com'},
            {'username':'hanishawinerti.osh@gmail.com', 'password': 'QfyE4602+', 'email': 'hanishawinerti.osh@gmail.com'},
            {'username':'helmirahman.osh@gmail.com', 'password': 'QisE7434*', 'email': 'helmirahman.osh@gmail.com'},
            {'username':'hernayunita.osh@gmail.com', 'password': 'XqjP1058*', 'email': 'hernayunita.osh@gmail.com'},
            {'username':'hildaapn.osh@gmail.com', 'password': 'HccW6642*', 'email': 'hildaapn.osh@gmail.com'},
            {'username':'mairaabrari.osh@gmail.com', 'password': 'HhaQ3561+', 'email': 'mairaabrari.osh@gmail.com'},
            {'username':'ignatiusaditya.osh@gmail.com', 'password': 'JoiL5205+', 'email': 'ignatiusaditya.osh@gmail.com'},
            {'username':'Ikhmirabashasa.osh@gmail.com', 'password': 'HffM6085*', 'email': 'Ikhmirabashasa.osh@gmail.com'},
            {'username':'ingridgracelia.osh@gmail.com', 'password': 'CbyC9374+', 'email': 'ingridgracelia.osh@gmail.com'},
            {'username':'ismidznillah.osh@gmail.com', 'password': 'PvxE5354*', 'email': 'ismidznillah.osh@gmail.com'},
            {'username':'jayamorisihite.osh@gmail.com', 'password': 'QswX7683+', 'email': 'jayamorisihite.osh@gmail.com'},
            {'username':'jenitaanastasya.osh@gmail.com', 'password': 'MczT6238*', 'email': 'jenitaanastasya.osh@gmail.com'},
            {'username':'kaniafitriantiz.osh@gmail.com', 'password': 'ZtvN7496+', 'email': 'kaniafitriantiz.osh@gmail.com'},
            {'username':'tikaws.osh@gmail.com', 'password': 'UtuP1842+', 'email': 'tikaws.osh@gmail.com'},
            {'username':'kaylaelsafer.osh@gmail.com', 'password': 'CkgH5120+', 'email': 'kaylaelsafer.osh@gmail.com'},
            {'username':'khairunnisa.osh@gmail.com', 'password': 'BsgV1797*', 'email': 'khairunnisa.osh@gmail.com'},
            {'username':'lailahidayatunnurrohmah.osh@gmail.com', 'password': 'RwrS1626+', 'email': 'lailahidayatunnurrohmah.osh@gmail.com'},
            {'username':'maurastephanie.osh@gmail.com', 'password': 'WktV9147*', 'email': 'maurastephanie.osh@gmail.com'},
            {'username':'mawadatuntaahsana.osh@gmail.com', 'password': 'VzwL3329*', 'email': 'mawadatuntaahsana.osh@gmail.com'},
            {'username':'methaniapc.osh@gmail.com', 'password': 'AhdF8170*', 'email': 'methaniapc.osh@gmail.com'},
            {'username':'fathanmujahid.osh@gmail.com', 'password': 'DgkH4111+', 'email': 'fathanmujahid.osh@gmail.com'},
            {'username':'olensavero.osh@gmail.com', 'password': 'DloQ9326*', 'email': 'olensavero.osh@gmail.com'},
            {'username':'mrijalfatihah.osh@gmail.com', 'password': 'LcsP2533+', 'email': 'mrijalfatihah.osh@gmail.com'},
            {'username':'shidqiaqila.osh@gmail.com', 'password': 'KcjB3367*', 'email': 'shidqiaqila.osh@gmail.com'},
            {'username':'syaifulaziz.osh@gmail.com', 'password': 'NwqY6856*', 'email': 'syaifulaziz.osh@gmail.com'},
            {'username':'yudharzky.osh@gmail.com', 'password': 'ItnI6451+', 'email': 'yudharzky.osh@gmail.com'},
            {'username':'nabilaelrosy.osh@gmail.com', 'password': 'PfrY4779+', 'email': 'nabilaelrosy.osh@gmail.com'},
            {'username':'nadiamutiarahasna.osh@gmail.com', 'password': 'YbcJ7887+', 'email': 'nadiamutiarahasna.osh@gmail.com'},
            {'username':'nadillazahra.osh@gmail.com', 'password': 'HynK3835*', 'email': 'nadillazahra.osh@gmail.com'},
            {'username':'najwamaulidia.osh@gmail.com', 'password': 'NesM1884+', 'email': 'najwamaulidia.osh@gmail.com'},
            {'username':'naqvimaarif.osh@gmail.com', 'password': 'GkgE5983*', 'email': 'naqvimaarif.osh@gmail.com'},
            {'username':'normasaprila.osh@gmail.com', 'password': 'TtwD8389+', 'email': 'normasaprila.osh@gmail.com'},
            {'username':'novielisabethh.osh@gmail.com', 'password': 'KxnE3018*', 'email': 'novielisabethh.osh@gmail.com'},
            {'username':'nurindasah.osh@gmail.com', 'password': 'ZucC1775+', 'email': 'nurindasah.osh@gmail.com'},
            {'username':'nurrokhmahk.osh@gmail.com', 'password': 'YfmV2970*', 'email': 'nurrokhmahk.osh@gmail.com'},
            {'username':'raniamasyita.osh@gmail.com', 'password': 'TwsA5827*', 'email': 'raniamasyita.osh@gmail.com'},
            {'username':'rosyidaanadhifa.osh@gmail.com', 'password': 'MhsC9661+', 'email': 'rosyidaanadhifa.osh@gmail.com'},
            {'username':'sabilanur.osh@gmail.com', 'password': 'FyjY1046+', 'email': 'sabilanur.osh@gmail.com'},
            {'username':'bilaadwitya.osh@gmail.com', 'password': 'IcqK3081*', 'email': 'bilaadwitya.osh@gmail.com'},
            {'username':'salsabillape.osh@gmail.com', 'password': 'DxsF2929+', 'email': 'salsabillape.osh@gmail.com'},
            {'username':'mahirash.osh@gmail.com', 'password': 'JxdU1194*', 'email': 'mahirash.osh@gmail.com'},
            {'username':'sinnestyavioo.osh@gmail.com', 'password': 'PukN7411+', 'email': 'sinnestyavioo.osh@gmail.com'},
            {'username':'sukmawidya.osh@gmail.com', 'password': 'RmhR8198*', 'email': 'sukmawidya.osh@gmail.com'},
            {'username':'susiantynvs.osh@gmail.com', 'password': 'VilN9192+', 'email': 'susiantynvs.osh@gmail.com'},
            {'username':'syahlanuraliza.osh@gmail.com', 'password': 'ShjD6155*', 'email': 'syahlanuraliza.osh@gmail.com'},
            {'username':'syakirahokt.osh@gmail.com', 'password': 'ZnpQ9188+', 'email': 'syakirahokt.osh@gmail.com'},
            {'username':'lisaviraazka.osh@gmail.com', 'password': 'GixJ1268+', 'email': 'lisaviraazka.osh@gmail.com'},
            {'username':'tiaradewani.osh@gmail.com', 'password': 'HxbA8772*', 'email': 'tiaradewani.osh@gmail.com'},
            {'username':'virgitakh.osh@gmail.com', 'password': 'CfeA5889*', 'email': 'virgitakh.osh@gmail.com'},
            {'username':'vivinnurhalimah.osh@gmail.com', 'password': 'YhpY8945+', 'email': 'vivinnurhalimah.osh@gmail.com'},
            {'username':'yeninurcholisah.osh@gmail.com', 'password': 'AbgU1670*', 'email': 'yeninurcholisah.osh@gmail.com'},
            {'username':'yodiamara.osh@gmail.com', 'password': 'ZkmA9952*', 'email': 'yodiamara.osh@gmail.com'},
            {'username':'yohanestegar.osh@gmail.com', 'password': 'YcfD9983*', 'email': 'yohanestegar.osh@gmail.com'},
            {'username':'yunindaaf.osh@gmail.com', 'password': 'VufO4248*', 'email': 'yunindaaf.osh@gmail.com'},
            {'username':'zahraalima.osh@gmail.com', 'password': 'AwgM6021*', 'email': 'zahraalima.osh@gmail.com'},
            {'username':'zahramidina.osh@gmail.com', 'password': 'WhhG9055+', 'email': 'zahramidina.osh@gmail.com'},
            {'username':'zhafirafarah.osh@gmail.com', 'password': 'NwsH1646*', 'email': 'zhafirafarah.osh@gmail.com'},

            # Add more user data as needed
        ]
        for data in users_data:
            user = User.objects.create_user(**data)
            UserProfile.objects.create(user=user)
        self.stdout.write(self.style.SUCCESS('Users seeded successfully.'))
