django syncdb create superusers error

使用django syncdb创建管理后台时出现
You just installed Django’s auth system, which means you don’t have any superusers defined.
Would you like to create one now? (yes/no): yes
line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None
发现创建用户失败

发现可以手动创建用户

python manage.py shell

from django.contrib.auth.models import User 
u = User.objects.create_user('admin', 'test@test.com', 'adminpwd')
u.is_staff  =  True
u.is_superuser = True
u.save()
  1. 暂无评论

  1. 暂无 Trackback

return top