在https://github.com/shaunsephton/django-ckeditor上,设置 django-ckeditor 的指令集包括:
4. 运行 collectstatic 管理命令:
$ ./manage.py 收集静态
这会将静态 CKEditor 需要的媒体资源复制到 STATIC_ROOT 设置给定的目录中。有关更多信息,请参阅 Django 关于管理静态文件的文档。
但是,当我尝试这样做时,出现错误:
$ python manage.py collectstatic
/usr/lib/python2.7/dist-packages/django/conf/__init__.py:221: DeprecationWarning: You have no filters defined on the 'mail_admins' logging handler: adding implicit debug-false-only filter. See http://docs.djangoproject.com/en/dev/releases/1.4/#request-exceptions-are-now-always-logged
DeprecationWarning)
You have requested to collect static files at the destination
location as specified in your settings.
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 12: ordinal not in range(128)
我怎样才能最好地解决问题,以便 django-ckeditor 拥有它想要的静态文件?
在 settings.py 中,我现在有:
DIRNAME = os.path.dirname(__file__)
STATIC_ROOT = DIRNAME + '/static/'
print STATIC_ROOT
从外壳:
You are in a maze of twisted little Infocom parodies, all alike.
~/ccachicago > python manage.py collectstatic
/home/jonathan/ccachicago/static/
/home/jonathan/ccachicago/../ccachicago/static/
/usr/lib/python2.7/dist-packages/django/conf/__init__.py:221: DeprecationWarning: You have no filters defined on the 'mail_admins' logging handler: adding implicit debug-false-only filter. See http://docs.djangoproject.com/en/dev/releases/1.4/#request-exceptions-are-now-always-logged
DeprecationWarning)
You have requested to collect static files at the destination
location as specified in your settings.
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 12: ordinal not in range(128)
You are in a maze of twisted little Infocom parodies, all alike.
~/ccachicago >
我不敢说“我做不到”,但我是在 Unix 上长大的,在这个 Ubuntu 服务器上只会使用传统的 Unix 文件名字符。
我不明白为什么我会提供任何传统上不属于 Unix 文件名的字符,而且它似乎只报告传统的 Unix 文件名。
还有其他方法可以绊倒非 ASCII 字符吗?假设我在 Unix 无法与智能引号、重音字符等相处的所有地方都只使用了 ASCII 字符。