Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sorl.thumbnail.ImageField not showing thumbnails with the AdminImageMixin #384

Open
int-ua opened this issue Jul 20, 2015 · 6 comments
Open

Comments

@int-ua
Copy link

int-ua commented Jul 20, 2015

sorl-thumbnail==12.3
Django==1.8.3
Pillow==2.9.0

from sorl.thumbnail import ImageField as SorlImage
class Person(PublishedMixin):
    photo = SorlImage(upload_to='photos', blank=True, null=True)
...
from sorl.thumbnail.admin import AdminImageMixin as SorlImageAdmin
from reversion import VersionAdmin

class Admin(VersionAdmin):
    exclude = []

    class Media:
        css = {
            'all': ('css/admin_forms.css',)
        }

@register(Person)
class PersonAdmin(Admin, SorlImageAdmin):
...

I don't see any changes to the admin form compared to the default one, nothing in console output. Both with and without Grappelli activated.

@ulyssesv
Copy link

ulyssesv commented Dec 16, 2015

The root cause of this problem for me was that there were no migrations available for sorl. I'm using python 3.5, django 1.9 and sorl 13.2 with Pillow.

I didn't have time to investigate why the migration was not being applied, but I believe that it may have to be something about django 1.9 or AppConfig...

Ugly temporary fix below...

$ python manage.py migrate thumbnail
CommandError: App 'thumbnail' does not have migrations.
$ python manage.py makemigrations thumbnail
Migrations for 'thumbnail':
  0001_initial.py:
    - Create model KVStore
$ python manage.py migrate
Operations to perform:
  Apply all migrations: <...>
Running migrations:
  Rendering model states... DONE
  Applying thumbnail.0001_initial... OK

@iknowmac
Copy link

bump...

@mariocesar
Copy link
Collaborator

try to use latest sorl.thumbnail version

pip install --pre --upgrade sorl-thumbnail

It has migrations

@iknowmac
Copy link

Worked great, thanks.

@amigo
Copy link

amigo commented Jan 21, 2016

It's works! Thank you.

@MaximePommier
Copy link

Thanks for this trick !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants