gpt4 book ai didi

python - django createsuperuser 不工作

转载 作者:太空狗 更新时间:2023-10-29 20:34:29 24 4
gpt4 key购买 nike

.bash_profile

export PATH="/Applications/MAMP/bin:/usr/local/bin:/usr/local/sbin:usr/local/$
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

export LANG="en_US.UTF-8"

.个人资料

export PATH="/Applications/MAMP/bin:/usr/local/bin:/usr/local/sbin:usr/local/my$
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
export LANG="en_US.UTF-8"

错误

Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle
default_username = get_default_username()
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 105, in get_default_username
default_username = get_system_username()
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 459, in getdefaultlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 391, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

疑问

我也将我的 LANG 更改为 UTF-8,但我仍然无法解决问题,请帮忙

最佳答案

你看到这个是因为你没有在你的系统上设置语言环境。您需要设置它才能创建 super 用户,它是已知的并已报告“错误”。

见: https://code.djangoproject.com/ticket/17649

假设您使用的是 linux,您可以通过以下方式修复该错误

export LANG="en_US.UTF-8"

您可以在终端中使用它,但您可以轻松地检查并查看如何更改系统上的语言环境,只需谷歌搜索即可。

如果您正在使用:

Ubuntu - https://help.ubuntu.com/community/Locale/

Archlinux - https://wiki.archlinux.org/index.php/Locale

...

关于python - django createsuperuser 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11593556/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com