gpt4 book ai didi

django - I18n停止工作

转载 作者:行者123 更新时间:2023-12-04 13:26:58 37 4
gpt4 key购买 nike

我总是使用此脚本来编译django.po,并且一直在工作:

#!/bin/sh
django-admin.py makemessages -a
django-admin.py compilemessages

突然它停止工作,并出现以下错误:
$ i18n.sh
Traceback (most recent call last):
File "c:/Python34/Scripts/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "c:\Python34\lib\site-packages\django\core\management\__init__.py", line
385, in execute_from_command_line
utility.execute()
File "c:\Python34\lib\site-packages\django\core\management\__init__.py", line
377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "c:\Python34\lib\site-packages\django\core\management\base.py", line 288,
in run_from_argv
self.execute(*args, **options.__dict__)
File "c:\Python34\lib\site-packages\django\core\management\base.py", line 338,
in execute
output = self.handle(*args, **options)
File "c:\Python34\lib\site-packages\django\core\management\base.py", line 533,
in handle
return self.handle_noargs(**options)
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 283, in handle_noargs
potfiles = self.build_potfiles()
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 299, in build_potfiles
file_list = self.find_files(".")
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 358, in find_files
ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings
.STATIC_ROOT)]
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 358, in <listcomp>
ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings
.STATIC_ROOT)]
File "c:\Python34\lib\ntpath.py", line 491, in normpath
if path.startswith(special_prefixes):
AttributeError: 'NoneType' object has no attribute 'startswith'
processing file django.po in c:\Users\Debora\workspace\opti\opti2.0\project\loca
le\pt_BR\LC_MESSAGES

有人有什么想法吗?

我不知道是什么原因造成的。最近,我将django 1.7更新为1.7.1,安装了一些不相关的软件包,这就是我记得这样做可能会受到影响的软件包。

最佳答案

只需在settings.py文件中设置STATIC_ROOT

这是bug in Django 1.7.1,应在Django 1.7.2中删除

(由于Django 1.6.2 STATIC_ROOT 默认为None,所以在''之前。)

关于django - I18n停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26675881/

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