标签:
admin用户非交互式创建:
echo "from django.contrib.auth.models import User; User.objects.create_superuser(‘myadmin‘, ‘myemail@example.com‘, ‘hunter2‘)" | python manage.py shell
依赖auth.user的数据库迁移:
python manage.py migrate auth
python manage.py migrate
参考资料:
http://stackoverflow.com/questions/1466827/automatically-create-an-admin-user-when-running-djangos-manage-py-syncdb
http://stackoverflow.com/questions/29689365/auth-user-error-with-django-1-8-and-syncdb-migrate
【Django】依赖auth.user的数据库迁移,以及admin用户非交互式创建
标签:
原文地址:http://www.cnblogs.com/junneyang/p/5481804.html