nsog8sm43x
nsog8sm43x

Reputation: 349

How to fix the error that occurs when upgrading django 1.10 to 1.11?

After upgrading django from 1.10 to 1.11, I can't use the manage.py command. There are so many errors that I do not even know where to start and where to look for the cause of errors. I will be grateful for any help.

I paste all errors below.

  File "SAGI-B/manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "/home/marcin/.vens/sagi/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 "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/filer/models/__init__.py", line 3, in <module>
    from .clipboardmodels import *  # flake8: noqa
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/filer/models/clipboardmodels.py", line 9, in <module>
    from . import filemodels
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/filer/models/filemodels.py", line 18, in <module>
    from ..fields.multistorage_file import MultiStorageFileField
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/filer/fields/multistorage_file.py", line 12, in <module>
    from easy_thumbnails import fields as easy_thumbnails_fields
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/easy_thumbnails/fields.py", line 2, in <module>
    from easy_thumbnails import files
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/easy_thumbnails/files.py", line 14, in <module>
    from easy_thumbnails import engine, exceptions, models, utils, signals, storage
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/easy_thumbnails/engine.py", line 12, in <module>
    from easy_thumbnails import utils
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/easy_thumbnails/utils.py", line 15, in <module>
    from easy_thumbnails.conf import settings
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/easy_thumbnails/conf.py", line 334, in <module>
    settings = Settings()
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/easy_thumbnails/conf.py", line 21, in __init__
    super(AppSettings, self).__init__(*args, **kwargs)
TypeError: __init__() takes exactly 2 arguments (1 given)

I have upgraded all dependencies with the command pip list --outdated --format = freeze | grep -v '^ \ - e' | cut -d = -f 1 | xargs -n1 pip install -U, which I found here: enter link description here

Now the number of errors has decreased to a few. I paste them below.

Traceback (most recent call last):
  File "SAGI-B/manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "/home/marcin/.vens/sagi/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 "/home/marcin/.vens/sagi/local/lib/python2.7/site-packages/cmsplugin_filer_file/models.py", line 10, in <module>
    from filer.utils.compatibility import python_2_unicode_compatible
ImportError: cannot import name python_2_unicode_compatible

Upvotes: 0

Views: 236

Answers (1)

Alasdair
Alasdair

Reputation: 309099

Your pip install -U command has upgraded easy-thumbnails to 2.7.0, but that version dropped support for Django 1.11.X

Support for Django 1.11 was added in 2.5.0, so either 2.5.0 or 2.6.0 should work (depending on other requirements). You could install 2.6 with:

pip install --upgrade "easy-thumbnails<2.7.0"

Upvotes: 1

Related Questions