Take the 2-minute tour ×

I'm working on and project that uses two separate modular Django apps. However, one app requires easy-thumbnails and the other requires sorl-thumbnails. Unfortunately, the two thumbnail libraries make use of the template tag syntax {% load thumbnail %}, so they clash and break when a template using them tries to render.

Are there any approaches to solve this type of clash? (For example, a template option does to the effect of {% load thumbnail as easy_thumbnail %}). Am I going to have to fork one of the apps and replace one of the thumbnail libraries with another? If so, which should I choose to go with?

Thank you for considering my question, Joe

share|improve this question
you should give github.com/codysoyland/django-smart-load-tag a try :) –  Paulo Nov 18 '11 at 0:13
That's a really neat module that seems like it will solve exactly this problem. I think I saw a django ticket to add similar functionality to django trunk. I hope it makes it in. Nice that this module exists for current and past instances of django. –  Joe J Nov 18 '11 at 17:29
add comment

2 Answers

up vote 9 down vote accepted

Sure, just write your own stub easy_thumbnail wrapper...

  1. Create a thumbnailtags package in one of your django apps...
  2. ...making sure it's got an empty __init__.py
  3. In thumbnailtags/easy_thumbnail.py do something like:

    from django.template import Library
    from easy_thumbnails.templatetags import thumbnail
    register = Library()    
    def easy_thumbnail(parser, token):
        return thumbnail(parser, token)
  4. Use {% load easy_thumbnail %}


You might also be able to do 'import thumbnail as easy_thumbnail, and skip the def easy_thumbnail bit, tho I've not tried that.

share|improve this answer
add comment

Your Answer


