Login

Tag "encode"

Snippet List

Encode emails as URIs

Put this snippet in a file in a templatetags/ directory and load it in your templates. Then use it to encode your emails: `{{"[email protected]"|html_encode_email}}` Or if you want some control over the anchor tag: `<a href="mailto:{{"[email protected]"|html_encode}}&subject=Feedback">Send Feedback</a>` From [fahhem.com](http://fahhem.com/) and [Recrec Labs](http://recreclabs.com/)

  • templatetag
  • email
  • spam
  • encode
Read More

JSON encoding middleware

Makes it really easy to return JSON from your views: just return a dict. (Also from [django-webapp](http://code.google.com/p/django-webapp/).)

  • middleware
  • serialize
  • json
  • encode
  • encoding
  • serializer
Read More

encode_mailto

This is a django filter which will create an html mailto link when you use the syntax: {{ "[email protected]"|encode_mailto:"Name" }} Results in: <a href="mailto:[email protected]">Name</a> Except everything is encoded as html digits. The encoding is a string of html hex and decimal entities generated randomly. If you simply want a string encoding use: {{ "name"|encode_string }} This was inspired by John Gruber's [Markdown](http://daringfireball.net/projects/markdown/syntax#autolink) project

  • filter
  • email
  • encode
Read More

3 snippets posted so far.