Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

创建用户后无法登录 #12

Open
huanjing-lin opened this issue May 11, 2020 · 2 comments
Open

创建用户后无法登录 #12

huanjing-lin opened this issue May 11, 2020 · 2 comments

Comments

@huanjing-lin
Copy link

在终端使用createsuperuser命令创建用户和密码后,在数据库中可以看到新建的密码,但是在网页上却一直显示密码错误(但是密码并没有输入错误)。。。

@amsmoking
Copy link

1)生成加密登录口令

/opt/python2.7.13/bin/python

from hashlib import sha1
passwd_sha1 = sha1()
passwd_sha1.update('123456')
passwd_sha1.hexdigest()
'7c4a8d09ca3762af61e59520943dc26494f8941b'

2)插入数据

登陆mysql后,use imoocc库

然后插入一个admin的用户、密码如下:

insert into userinfo (id,user_name,user_passwd,user_level) values (1,'admin','7c4a8d09ca3762af61e59520943dc26494f8941b','2')

@amsmoking
Copy link

账号 admin 密码 123456.
注意:不要多次update。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants