【Django】依赖auth.user的数据库迁移,以及admin用户非交互式创建

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://*.com/questions/1466827/automatically-create-an-admin-user-when-running-djangos-manage-py-syncdb

http://*.com/questions/29689365/auth-user-error-with-django-1-8-and-syncdb-migrate

上一篇:安卓使用spinner控件和pull解析实现全国省市县的三级联动


下一篇:Linux学习笔记(22) Linux启动管理