Snippet List
By using this simple wrapper instead of Django's default send_mail function, you gain the peace of mind of knowing that when settings.DEBUG == True, all the emails will be sent to you instead of the original recipient. Handy for testing.
- email
- debug
- testing
- mail
- intercept
- trap
Use this to display a split of page execution time between python and the db in your base template when debugging.
I originally got the base of this code from another snippet, but I can't find it anymore and want to share with new folks because I find this handy.
- middleware
- profile
- time
- debug
- performance
- query
- basetemplate
Given an item and a list, check if the item is in the list
-----
item = 'a'
list = [1, 'b', 'a', 4]
-----
{% ifinlist item list %}
Yup, it's in the list
{% else %}
Nope, it's not in the list
{% endifinlist %}
Displays hotshot profiling for any view.
http://yoursite.com/yourview/?prof
Add the "prof" key to query string by appending ?prof (or &prof=)
and you'll see the profiling results in your browser.
It's set up to only be available in django's debug mode,
but you really shouldn't add this middleware to any production configuration.
* Only tested on Linux
* You should probably use this one instead: http://djangosnippets.org/snippets/2126/
- middleware
- profile
- debug
- stats
- performance
- hotshot
udfalkso has posted 4 snippets.