Django:无法在命令行上设置超级用户的密码
在 Django 教程 中,我处于“You”部分您将看到它创建的每个数据库表的一条消息,并且您将收到一条提示,询问您是否要为身份验证系统创建一个超级用户帐户,请继续执行此操作。”我正在使用 Django 1.2.3。
如果相关的话,我正在使用 SQLite,并且在 mysite 下的设置文件中,我没有设置密码,因为您应该将 SQLite 的密码留空。但现在我正在命令行中设置超级用户帐户,并且要求我设置密码。而且它不让我打字。
所以我将其留空,然后按回车键(这确实有效),它要求我确认我的密码。我再次按下回车键。它告诉我,“错误:您的密码不匹配。”
有什么原因不允许我输入任何文本吗?有办法解决这个问题吗?这只是一个开发服务器,所以如果解决方案根本不设置密码我也没关系,但它也不让我这样做。
好的,所以我知道我必须输入非空的内容。问题是,命令行实际上不允许我在那里输入内容。我按下按键,闪烁的小下划线没有动。它允许我做的就是在它仍然是空白的时候按回车键,但是空密码不匹配。我想知道为什么它不让我打字。
In the Django tutorial, I'm at the part that says "You'll see a message for each database table it creates, and you'll get a prompt asking you if you'd like to create a superuser account for the authentication system. Go ahead and do that." I'm using Django 1.2.3.
In case it's relevant, I'm using SQLite, and in the settings file under mysite, I didn't set a password because you're supposed to leave it blank for SQLite. But right now I'm setting up the superuser account in the command line and it's demanding that I set a password. And it won't let me type.
So I leave it blank, and hit enter (which does work), and it asks me to confirm my password. I hit enter again. And it tells me, "Error: Your passwords didn't match."
Is there a reason it won't let me enter any text? Is there a way to get around this? This is just a development server, so I'm OK if the solution involves not setting a password at all, but it's not letting me do that either.
OK, so I know I have to enter something non-empty. The problem is, the command line is literally not letting me type there. I hit keys and the little blinking underscore doesn't move. All it will allow me to do is hit enter while it's still blank, but then the empty passwords don't match. I want to know why it's not letting me type.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不应该看到您正在输入的密码。只需输入您的密码,出现提示时重复完全相同的密码,就可以了。
You are not suppose to see the password you are typing. Just type your password, repeat exactly same password when prompted and you should be ok.
Django 超级用户密码独立于用于向数据库服务器进行身份验证的密码。它不允许您设置非空密码的原因是它存在安全风险; Django 并不关心你的应用程序永远不会被公开使用。
The Django superuser password is independent of the password used to authenticate with the database server. The reason it won't let you set a non-blank password is because it's a security risk; Django doesn't care that your app will never see public use.
身份验证模块的密码与您的数据库是分开的。您必须为超级用户设置一个非空密码。
The password for the authentication module is separate from your database. You'll have to set a non-blank password for the superuser.