0

here is what i did:

> 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

when i try to log in: http://127.0.0.1:8000/admin/, it keeps saying that the user/pass conbination is wrong. is there any specific files i need to enable admin page?

iCodeLikeImDrunk
  • 17,085
  • 35
  • 108
  • 169

3 Answers3

1

Like what agf said in his comment, it looks to be a db setting issue. There's a difference between what's defined in your models and what's defined in the db.

Check to see if you've ran ./manage.py syncdb or what happens when you run ./manage.py validate?

Update Based on Comment

App Engine does not support Django models. You have to write your models using App Engine's db.models or ndb.models API.

See this link: data is stored on localhost but not on gae datastore?

Community
  • 1
  • 1
super9
  • 29,181
  • 39
  • 119
  • 172
  • this is what i get from syncdb: Creating tables ... Installing custom SQL ... Installing indexes ... No fixtures found. Exception AttributeError: "'NoneType' object has no attribute 'mkstemp'" in .DatastoreFileStub object at 0x028C3310>> ignored – iCodeLikeImDrunk May 01 '12 at 17:14
  • are you using django or django-nonrel? – dragonx May 02 '12 at 18:01
0

If you're using the 1.6.4 SDK, there's a bug where the database doesn't save on exit().

I believe this is fixed on 1.6.5.

dragonx
  • 14,963
  • 27
  • 44
  • where can i check for the version? i think my team "leader" probably just copy paste someone else's work... – iCodeLikeImDrunk May 01 '12 at 02:57
  • Actually, I've heard that it's still broken on 1.6.5 (haven't confirmed myself). See this question for reference: http://stackoverflow.com/questions/10060172/gae-sdk-1-6-4-dev-appserver-datastore-flush – dragonx May 02 '12 at 18:00
0

Furthermore, users[0] does not make the whole QuerySet evaluated and cached. You need to evaluate whole QuerySet or assign users[0] to some variable and use the variable:

>>> users[0] is users[0]
False
>>> user = users[0]
>>> user is user
True
>>> len(users); users[0] is users[0]
True

leader难当啊~

okm
  • 23,575
  • 5
  • 83
  • 90