django自定义命令【示例】
from django.core.management.base import BaseCommand
from ... import models
class Command(BaseCommand):
def handle(self, *args, **options):
username = input("用户名:")
password = input("密码:")
models.User.objects.create(username=username, password=password, is_super=True)
print("创建成功")