create_admin.sh 471 B

123456
  1. #! /bin/bash
  2. username=$(cat credentials.json | python -c "import sys, json; print(json.load(sys.stdin)['username'])")
  3. password=$(cat credentials.json | python -c "import sys, json; print(json.load(sys.stdin)['password'])")
  4. email=$(cat credentials.json | python -c "import sys, json; print(json.load(sys.stdin)['email'])")
  5. echo "from django.contrib.auth.models import User; User.objects.create_superuser('${username}', '${email}', '${password}')" | python manage.py shell