django管理命令,以编程方式创建可用的超级用户
django-createsuperuserwithpassword的Python项目详细描述
django createsuperuserwithpassword
…提供了一个django管理命令来创建准备登录的super 开发过程中的用户。
如何使用
一。安装
在本地或全局安装pip包:
pip install [--user] django-createsuperuserwithpassword
2.激活
通过扩展Django项目启用Django管理命令 设置:
INSTALLED_APPS+=("django_createsuperuserwithpassword",)
三。应用
调用命令-例如从容器入口点脚本中 这个:
python manage.py createsuperuserwithpassword \ --username admin \ --password admin \ --email admin@example.org \ --preserve
开发
如果你想帮助修复一个bug,一个简单的方法来加速开发 环境是:
git clone https://github.com/hartwork/django-createsuperuserwithpassword
cd django-createsuperuserwithpassword
docker-compose up --build