jazzband / sorl-thumbnail

Thumbnails for Django
https://sorl-thumbnail.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.74k stars 493 forks source link

Django 1.7 problem? #266

Closed petkostas closed 10 years ago

petkostas commented 10 years ago

Hello I am experiencing problems with sorl and django 1.7 (testing environment):

(zenbframework)vagrant@precise64:/python-projects/zenbframework/zenframework$ pip freeze
Django==1.7b1
Pillow==2.4.0
argparse==1.2.1
django-braces==1.4.0
django-crispy-forms==1.4.0
django-mptt==0.6.0
redis==2.9.1
six==1.6.1
sorl-thumbnail==11.12
unicode-slugify==0.1.1
wsgiref==0.1.2

My settings:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'sorl.thumbnail',
    'posts',
    'news',
)

Trying to run migrate (replaces syncdb):

(zenbframework)vagrant@precise64:/python-projects/zenbframework/zenframework$ ./manage.py migrate
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vagrant/.virtualenvs/zenbframework/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 427, in execute_from_command_line
    utility.execute()
  File "/home/vagrant/.virtualenvs/zenbframework/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 391, in execute
    django.setup()
  File "/home/vagrant/.virtualenvs/zenbframework/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/vagrant/.virtualenvs/zenbframework/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/vagrant/.virtualenvs/zenbframework/local/lib/python2.7/site-packages/django/apps/config.py", line 120, in create
    "cannot import name '%s' from '%s'" % (cls_name, mod_path))
ImportError: cannot import name 'thumbnail' from 'sorl'
kuyucakli commented 10 years ago

Can someone give a short explanation on django 1.7 compability? I am getting

from sorl.thumbnail.helpers import get_module_class File ".../django_python3.3/lib/python3.3/site-packages/sorl/thumbnail/helpers.py", line 55 except ImportError, e: ^ SyntaxError: invalid syntax

Starou commented 10 years ago

Looks like it is related to simplejson package that used to be shipped-in Django pre 1.7.

sorl/thumbnail/helpers.py in () 3 from django.utils.encoding import smart_str 4 from django.utils.importlib import import_module ----> 5 from django.utils import simplejson 6 7

ImportError: cannot import name simplejson

relekang commented 10 years ago

Can you try with the beta version of the upcoming release. Use pip install sorl-thumbnail==11.12.1b to get the newest verison.

treworld commented 10 years ago

The beta version (11.12.1b) fixed the problem for me.

ordersys commented 10 years ago

And for me. thank you.

hiway commented 10 years ago

Thank you! Would be nice if the beta (or at least the hotfix for this particular issue) is available by default for pip install - many Django users preparing for the 1.7 upgrade will be headed to this page otherwise.

mariocesar commented 10 years ago

it's available by

pip install sorl-thumbnail==11.12.1b
macs03 commented 10 years ago

i had the same problem and it solved with the version 11.12.1b thanks

kakulukia commented 9 years ago

+1 for releasing the beta as an official version .. at least i dont have startup problems with Django 1.7

ricardokamada commented 9 years ago

Thank you! here is ok with 11.12.1b

hiway commented 9 years ago

Thanks! This makes things awesome again :-D

jplehmann commented 9 years ago

:+1:

stilobique commented 9 years ago

Great ! No soucis with 11.12.b !

opbod commented 9 years ago

For some reason, a pip install sorl-thumbnail still installs the old 11.12 release for me (while 12.1c has been out on pip for a month now). The latest release (to date) can be obtained using pip install sorl-thumbnail==12.1c.

jonthdiaz commented 9 years ago

Thanks you!

SalahAdDin commented 9 years ago

Hey, now you can use pip install, the last version is 12.2

r05 commented 9 years ago

nice! thanks a lot

ricardokamada commented 9 years ago

Thanks Em 15/01/2015 04:25, "Ros" notifications@github.com escreveu:

nice! thanks a lot

— Reply to this email directly or view it on GitHub https://github.com/mariocesar/sorl-thumbnail/issues/266#issuecomment-70044951 .