mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
14 lines
472 B
Python
14 lines
472 B
Python
# coding=utf-8
|
|
from django.core.management.base import BaseCommand
|
|
from account.models import User, SUPER_ADMIN, UserProfile
|
|
|
|
|
|
class Command(BaseCommand):
|
|
def handle(self, *args, **options):
|
|
if User.objects.exists():
|
|
return
|
|
user = User.objects.create(username="root", real_name="root", email="root@oj.com", admin_type=SUPER_ADMIN)
|
|
user.set_password("password@root")
|
|
user.save()
|
|
UserProfile.objects.create(user=user)
|