为什么django在我尝试登录时无法识别我的管理员用户/密码?
以下是我所做的:为什么django在我尝试登录时无法识别我的管理员用户/密码?,django,google-app-engine,django-admin,Django,Google App Engine,Django Admin,以下是我所做的: > python manage.py createsuperuser Username (Leave blank to use 'joe'): admin E-mail address: random_email@yahoo.com Password: Password (again): Superuser created successfully. Exception AttributeError: "'NoneType' object has no attribute
> python manage.py createsuperuser
Username (Leave blank to use 'joe'): admin
E-mail address: random_email@yahoo.com
Password:
Password (again):
Superuser created successfully.
Exception AttributeError: "'NoneType' object has no attribute 'mkstemp'" in <bound method DatastoreFileStub.__del__ of <google.appengine.api.datastore_file_stub
.DatastoreFileStub object at 0x02928470>> ignored
> python manage.py shell
[1]: from django.contrib.auth.models import User
[2]: users = User.objects.all()
[3]: users
[3]: [<User: admin>]
[4]: users[0].set_password('password')
[5]: users[0].save()
[6]: exit()
Exeption AttributeError: "'NoneType' object has no attribute 'mkstemp'" in <bound method DatastoreFileStub.__del__ of <google.appengine.api.datastore_file_stub
tastoreFileStub object at 0x028D9490>> ignored
> python manage.py syncbd
Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.
Exception AttributeError: "'NoneType' object has no attribute 'mkstemp'" in <bound method DatastoreFileStub.__del__ of <google.appengine.api.datastore_file_stub
.DatastoreFileStub object at 0x02A83310>> ignored
> python manage.py validate
0 errors found
Exception AttributeError: "'NoneType' object has no attribute 'mkstemp'" in <bound method DatastoreFileStub.__del__ of <google.appengine.api.datastore_file_stub
.DatastoreFileStub object at 0x028A3310>> ignored
>python manage.py createsuperuser
用户名(留空使用“joe”):admin
电子邮件地址:随机_email@yahoo.com
密码:
密码(再次):
超级用户已成功创建。
异常AttributeError:“'NoneType'对象在忽略中没有属性'mkstemp'”
>python manage.py shell
[1] :从django.contrib.auth.models导入用户
[2] :users=User.objects.all()
[3] :用户
[3]: []
[4] :用户[0]。设置密码(“密码”)
[5] :用户[0]。保存()
[6] :exit()
Exeption AttributeError:“'NoneType'对象在忽略中没有属性'mkstemp'”
>python manage.py syncbd
正在创建表。。。
正在安装自定义SQL。。。
正在安装索引。。。
没有找到固定装置。
异常AttributeError:“'NoneType'对象在忽略中没有属性'mkstemp'”
>python manage.py验证
发现0个错误
异常AttributeError:“'NoneType'对象在忽略中没有属性'mkstemp'”
当我尝试登录时,它总是说用户/密码组合错误。是否有任何特定文件需要启用管理页?如果您使用的是1.6.4 SDK,则存在数据库在退出时不保存的错误()
我相信这是固定在1.6.5上的。此外,
用户[0]
不会对整个查询集进行评估和缓存。您需要计算整个QuerySet
或将用户[0]
分配给某个变量并使用该变量:
>>> users[0] is users[0]
False
>>> user = users[0]
>>> user is user
True
>>> len(users); users[0] is users[0]
True
领导难当啊~ 正如agf在评论中所说,这似乎是一个db设置问题。模型中定义的内容与数据库中定义的内容之间存在差异
检查是否运行了/manage.py syncdb
,或者运行/manage.py validate
时会发生什么情况
根据评论进行更新
App Engine不支持Django型号。你必须写你的简历
使用应用程序引擎的db.models或ndb.models API的模型
请参阅此链接:看起来您的数据库设置有问题。@agf我的“领导”设置了这个django项目,但他甚至不知道如何修复它,我猜他可能在某处偷了它。。。谢谢你的信息!在哪里可以查看版本?我认为我的团队“领导者”可能只是复制粘贴了其他人的作品……事实上,我听说它在1.6.5版上仍然被破坏(我自己还没有确认)。请参阅此问题以供参考:这是我从syncdb获得的结果:创建表。。。正在安装自定义SQL。。。正在安装索引。。。没有找到固定装置。异常AttributeError:“'NoneType'对象在0x028C3310>>处的.DatastoreFileStub对象中没有属性'mkstemp'”>忽略是否使用django或django nonrel?