old_contents: from django import template
  
  
  register = template.Library()
  
  
  CDN_HOST = 'cdn.research.pdx.edu'
  
  
  @register.simple_tag
  def cdn_url(path, scheme=None):
      """Generate a CDN URL like '//cdn.research.pdx.edu/some/path'.
  
      URLs generated by this function will not include an explicit scheme
      unless a ``scheme`` is passed. In most cases, not including the
      scheme is preferable because the browser will automatically use the
      scheme that was used to load the page.
  
      Example::
  
          {% load arc %}
          <script src="{% cdn_url 'jquery/2.1.1/jquery-2.1.1.min.js %}"></script>
  
      """
      url = '//{host}/{path}'.format(host=CDN_HOST, path=path.lstrip('/'))
      if scheme is not None:
          url = '{scheme}:{url}'.format(scheme=scheme, url=url)
      return url
  
new_contents: import json
  
  from django import template
  from django.utils.safestring import mark_safe
  
  
  register = template.Library()
  
  
  CDN_HOST = 'cdn.research.pdx.edu'
  
  
  @register.simple_tag
  def cdn_url(path, scheme=None):
      """Generate a CDN URL like '//cdn.research.pdx.edu/some/path'.
  
      URLs generated by this function will not include an explicit scheme
      unless a ``scheme`` is passed. In most cases, not including the
      scheme is preferable because the browser will automatically use the
      scheme that was used to load the page.
  
      Example::
  
          {% load arc %}
          <script src="{% cdn_url 'jquery/2.1.1/jquery-2.1.1.min.js %}"></script>
  
      """
      url = '//{host}/{path}'.format(host=CDN_HOST, path=path.lstrip('/'))
      if scheme is not None:
          url = '{scheme}:{url}'.format(scheme=scheme, url=url)
      return url
  
  
  @register.filter
  def jsonify(obj):
      return mark_safe(json.dumps(obj))
  
subject: Add jsonify template filter