我正在完全按照文档http://django-wiki.readthedocs.io/en/latest/installation.html中所示安装 django-wiki
当我尝试执行“python manage.py migrate”时,出现以下错误:
Traceback (most recent call last):
File "manage.py", line 13, in <module>
execute_from_command_line(sys.argv)
File "/var/www/unihotel/common_apps_1/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/var/www/unihotel/common_apps_1/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/var/www/unihotel/common_apps_1/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/var/www/unihotel/common_apps_1/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/var/www/unihotel/common_apps_1/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/lib/python2.7/site-packages/wiki/models/__init__.py", line 10, in <module>
from .article import * # noqa
File "/usr/lib/python2.7/site-packages/wiki/models/article.py", line 14, in <module>
from wiki.conf import settings
File "/usr/lib/python2.7/site-packages/wiki/conf/settings.py", line 3, in <module>
import bleach
File "/usr/lib/python2.7/site-packages/bleach/__init__.py", line 19, in <module>
from .sanitizer import BleachSanitizer
File "/usr/lib/python2.7/site-packages/bleach/sanitizer.py", line 5, in <module>
from html5lib.constants import tokenTypes
ImportError: cannot import name tokenTypes
但是当我用 python shell 导入它时......
>>> from html5lib.constants import tokenTypes
>>> print(tokenTypes)
{u'Comment': 6, u'StartTag': 3, u'EmptyTag': 5, u'Characters': 1, u'EndTag': 4, u'ParseError': 7, u'Doctype': 0, u'SpaceCharacters': 2}
...它工作得很好。
请,这方面的任何帮助都会很有用!