1

I have a dynamic html element that will appear on many pages in multiple apps. I'd like to resuse my custom templatetag / filter / inclusion tag code, say by putting it all in one app called utils. But when I try to load one such tag I am continually told that 'xyz' is not a registered tag library. Must be one of:...

Please help!

r_zelazny
  • 423
  • 3
  • 13
  • That should work I would think. One consideration noted in [this answer](http://stackoverflow.com/questions/5493776/django-current-tags-is-not-a-valid-tag-library) is that the app containing the template tag must be loaded before the apps using it (ie. settings.py INSTALLED_APPS). If your template tag was working before moving it to another app then the issue is likely just something with how you are loading it in now. – kjpc-tech Jan 13 '17 at 20:41
  • @fredriksapps The template engine is initialized way before the first template is rendered. I'd be really surprised if the order of `INSTALLED_APPS` mattered in any way in this case. – knbk Jan 13 '17 at 22:12
  • @r_zelazny are you loading the template tag library in the template where you are trying to use it? If so can you show me this? [Django Custom Template Tags Docs](https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/) – kjpc-tech Jan 13 '17 at 23:11

0 Answers0