jueves, 1 de marzo de 2012

My django snippets

In this post i'd like to share info on snippets i've shared on the very nice django-snippets.org.
My list
  • Encrypted paypal buttons :
    Use the code here if you want to encrypt your paypal buttons to pass sensitive information, like the receipt_id if you use it to validate a payment in your end.
  • Redirect to no slash:
    In django there is this setting APPEND_SLASH that does the oposite to my snippet, adds a slash and redirects there, but i wanted the oposite, i think urls look better like that.
    So far the only problem i've had with this approach is Facebook likes code. When you insert a facebook like iframe it checks the url you send it and follows redirections, so for urls with these kinds of codes you should disable the redirection.
  • Save image in field :I ended up not using this code, and instead i went with the more generic get_img_obj because i wanted a one function fits all to get images from external source inside my imagefields.
  • Send templated email with text | html | optional files
    Use this function to send email with html that automatically degrades to text if the client does not support html.
And finally i just added

No hay comentarios:

Publicar un comentario