Django 设置sqlite3管理财用户密码。
在未设置时登陆报错信息如下:
Please enter the correct username and password for a staff account. Note tha。。。。
进行设置如下:
1、清除原用户密码
E:\JavaCode\PythonWeb\MyWeb>python manage.py flush
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the ‘E:\JavaCode\PythonWe
b\MyWeb\db.sqlite3’ database,
and return each table to an empty state.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
2、设置用户密码
E:\JavaCode\PythonWeb\MyWeb>python manage.py createsuperuser
Username (leave blank to use ‘administrator’): admin
Email address: test@163.com
Password:
Password (again):
Superuser created successfully.
本文介绍如何在Django项目中使用sqlite3数据库并为管理员账号设置密码。首先需要清除原有的用户密码,然后通过创建超级用户的方式设定新的密码。
4331

被折叠的 条评论
为什么被折叠?



