Quem sou eu

Minha foto

Formado em Computação, desenvolvedor web, interessado em tecnologia, metaleiro e um gamer inveterado.

Pesquisar

sexta-feira, 19 de agosto de 2016

Erros Frequentes: Django==1.9.8 + django-ckeditor-updated==4.4.4 No module named util

Peguei o seguinte erro:


Traceback (most recent call last):
  File " in="" line="" manage.py="" module="">    execute_from_command_line(sys.argv)
  File "/var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 353, in execute_from_command_line
    utility.execute()
  File "/var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 327, in execute
    django.setup()
  File "/var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/django/apps/config.py", 
line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/var/www/SEU_SITE/app/blog/models.py", line 11, in 
    from ckeditor.fields import RichTextField
  File "/var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/ckeditor/fields.py", line 4, in 
    from ckeditor.widgets import CKEditorWidget
  File "/var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/ckeditor/widgets.py", line 10, in 
    from django.forms.util import flatatt
ImportError: No module named util

Para resolver, basta editar o arquivo /var/www/SEU_SITE/ENV/local/lib/python2.7/site-packages/ckeditor/widgets.py como abaixo:



Troque a linha:
django.forms.util import flatatt

Por:
django.forms.utils import flatatt