Skip to content

Instantly share code, notes, and snippets.

@dodolboks
Created December 19, 2015 18:20
Show Gist options
  • Save dodolboks/07dd1e51c8fe8134a5f5 to your computer and use it in GitHub Desktop.
Save dodolboks/07dd1e51c8fe8134a5f5 to your computer and use it in GitHub Desktop.
Custom django template to replace title filters. this filter used in production on https://kelaskita.com Kelas Belajar Online
from django import template
register = template.Library()
@register.filter
def titlefirst(value):
import re
s = re.sub("(^|\s)(\S)", repl_func, value)
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment