Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django how to create superuser if does not exists on migration

echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@myproject.com', 'password')" | python manage.py shell
 
PREVIOUS NEXT
Tagged: #django #create #superuser #exists #migration
ADD COMMENT
Topic
Name
8+5 =