Skip to content

Instantly share code, notes, and snippets.

@MarkusH
Created December 1, 2014 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkusH/d7faa8326b2e064c90e7 to your computer and use it in GitHub Desktop.
Save MarkusH/d7faa8326b2e064c90e7 to your computer and use it in GitHub Desktop.
TEMPLATE_STRING_IF_INVALID
class InvalidString(str):
def __mod__(self, other):
print(">>> DJANGO TEMPLATE ERROR: Undefined variable or unknown value for: \"%s\"" % other)
TEMPLATE_STRING_IF_INVALID = InvalidString("%s")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment