简体   繁体   中英

How can i use both easy thumbnails and sorl-thumbnail in the same django projects yet they have the same template tags?

I have this project where im using sorl-thumbnail to resize and crop my images on the template, in the same project i happen to use django CMS to manage my content, the problem is Django CMS needs ' easy-thumbnails for its filer app both apps use almost similar tags and i end up with this template syntax error placeholder', expected 'endblock'. Did you forget to register or load this tag? placeholder', expected 'endblock'. Did you forget to register or load this tag? when i try to use Django CMS {% placeholder 'mycontent' %} on my template.

looks like others have had this issue, and it remains unsolved: Django template tags with same name

If it's feasible to give up the use of one option or another, you could try loading one tag library before the other.

If that's not feasible, you still may have to try loading one tag library before the other, but make another tag library which imports the abandoned library, and makes another, uniquely-named tag which explicitly calls the inaccessible tag

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM