from django import template
register = template.Library()

from .. import sr as sr_func

@register.simple_tag(name='sr')
def sr_tag(key, *args, **kwargs):
    return sr_func(key, *args, **kwargs)

try:
    from django_jinja.base import Library
    jinja_register = Library()

    jinja_register.global_function("sr", sr_func)
except ImportError:
    pass

from django import template
register = template.Library()

from .. import sr as sr_func

@register.simple_tag(name='sr')
def sr_tag(key, *args, **kwargs):
    return sr_func(key, *args, **kwargs)


try:
    from django_jinja import library as jinja_library
    jinja_library.global_function("sr", sr_func)
except ImportError:
    pass

Update support for new django-jinja versions. (backward incompatible)
Update support for new django-jinja versions. (backward incompatible)

  from django import template
  register = template.Library()
  
  from .. import sr as sr_func
  
  @register.simple_tag(name='sr')
  def sr_tag(key, *args, **kwargs):
      return sr_func(key, *args, **kwargs)
  
+ 
  try:
+     from django_jinja import library as jinja_library
-     from django_jinja.base import Library
-     jinja_register = Library()
- 
-     jinja_register.global_function("sr", sr_func)
+     jinja_library.global_function("sr", sr_func)
  except ImportError:
      pass
  
Update support for new django-jinja versions. (backward incompatible)
## Code Before:
from django import template
register = template.Library()

from .. import sr as sr_func

@register.simple_tag(name='sr')
def sr_tag(key, *args, **kwargs):
    return sr_func(key, *args, **kwargs)

try:
    from django_jinja.base import Library
    jinja_register = Library()

    jinja_register.global_function("sr", sr_func)
except ImportError:
    pass

## Instruction:
Update support for new django-jinja versions. (backward incompatible)
## Code After:
from django import template
register = template.Library()

from .. import sr as sr_func

@register.simple_tag(name='sr')
def sr_tag(key, *args, **kwargs):
    return sr_func(key, *args, **kwargs)


try:
    from django_jinja import library as jinja_library
    jinja_library.global_function("sr", sr_func)
except ImportError:
    pass
