0

I'm installing django-wiki exactly as shown in the docs http://django-wiki.readthedocs.io/en/latest/installation.html

When I try to perform 'python manage.py migrate', I get the following error:

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    

But when I import it with the 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}

...it works just fine.

Please, any help on this would be useful!

Julie B
  • 51
  • 1
  • 5

1 Answers1

0

The problem was that manage.py was using other version of html5lib than the python interpreter. The easiest way to detect this is to go straight to the package file that caused the error, and print out the package version using app.__version__. Hope this helps someone.

Julie B
  • 51
  • 1
  • 5