I18n停止工作 [英] I18n stopped working

查看:128
本文介绍了I18n停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是用这个脚本来编译django.po,它一直在工作:

I always use this script to compile django.po and it was always working:

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

突然间,它停止工作,出现这个错误:

Suddenly it stopped working, with this error:

$ 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,安装了一些不相关的包,这是我记得做的可能会受到影响。

I don't know what caused this. recently I updated django 1.7 to 1.7.1, installed some packages unrelated, that's what I remember doing that could have affected.

推荐答案

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

Just set STATIC_ROOT in your settings.py file.

这是一个 Django 1.7.1中的错误,应该在Django 1.7.2中删除

This is a bug in Django 1.7.1 and should be removed in Django 1.7.2

(自 Django 1.6.2 STATIC_ROOT 默认为,之前''。)

这篇关于I18n停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆