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

conflicting template tag with django-debug-toolbar #331

Closed
krisfields opened this issue Jul 1, 2015 · 7 comments
Closed

conflicting template tag with django-debug-toolbar #331

krisfields opened this issue Jul 1, 2015 · 7 comments

Comments

@krisfields
Copy link

I get this error if I have both django-imagekit and django-debug-toolbar installed:

'compat' is not a valid tag library: Template library imagekit.templatetags.compat does not have a variable named 'register'

It looks like both django-imagekit and django-debug-toolbar have a templatetag file named compat.py.

Sorry about posting twice. I was logged in under someone else's account and didn't realize it.

@a1tus
Copy link
Contributor

a1tus commented Jul 1, 2015

Ran into this issue too and had to disable debug-toolbar.

@krisfields
Copy link
Author

I've determined that if I put debug-toolbar before django-imagekit in INSTALLED_APPS, the error goes away.

I think this should be ok since imagekit's compat doesn't actually seem to include any template tags - it's just being included by the imagekit templatetag file.

If you want to add debug-toolbar to INSTALLED_APPS in a local.py like I'm doing, you'll need to make sure it's added first instead of last, so something like this will work:
INSTALLED_APPS = ('debug_toolbar',) + INSTALLED_APPS

Or if you need to add it somewhere that is prior to imagekit, but not first, you could cast INSTALLED_APPS to a list, insert it where you wish, and cast it back to a tuple.

@matthewwithanm
Copy link
Owner

That makes total sense. If we move that file outside of the templatetags package, it should take care of it.

@dezoito
Copy link

dezoito commented Jul 23, 2015

Thank you, krisfields!

That fixed the issue for me too (after upgrading to Django 1.8).

@nex2hex
Copy link
Contributor

nex2hex commented Jul 28, 2015

same issue in django debug toolbar repo django-commons/django-debug-toolbar#734

@vstoykov
Copy link
Collaborator

vstoykov commented Dec 8, 2015

In django-debug-toolbar ver. 1.4 this is fixed by renaming their templatetag library to debug_toolbar_compat.

As @matthewwithanm suggested we can move our compat module from templatetags package because it is not a templatetag library. Even if now the problem is fixed in dajngo-debug-toolbar we need to fix this to prevent future conflicts with other packages.

Because I'm not sure where will be the right place to move the compat module I think of renaming it _compat.

What you think about this guys?

@vstoykov
Copy link
Collaborator

I've made a Pull request with moving the compat module outside of templatetags package. I decided not to rename it with underscore but to move it in the main package.

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