This Week in Django is a weekly podcast about all things Django.
This week we talk about a few source commits, some cool projects from the community, and a Tip of the Week. We also have some very special music by Watching Cars (see the show notes below for more information).
Please see the Show Notes below for all the pertinent information and links
Show Notes
TWiD Updates
- Poll Results – Which Django components, if any, have you used independently of Django?
1) None, I always use Django just like Adrian said – 70%
2) ORM – 17%
3) Template system – 7%
4) Admin Application – 4%
5) NewForms – 2%
- This Week’s Poll – Prior to coming to Django what language or framework were you using?
1) Rails
2) TurboGears
3) PHP
4) Seaside
5) Java
6) Asp.NET
Big News (13:38)
TWiD is one year old! December 14th of 2007 was our very first show. This was before Brian even was involved. We want to thank all of our audience and if it weren’t for you we would have never been able to make the first anniversary! Thank you for your support and expect to be back again for another anniversary.
Tracking Trunk (16:41)
- Split CsrfMiddleware into Two Parts
(9553)– Split CsrfMiddleware into two to make it more reusable. Also converted it to be a view middleware instead of request, as this allows more options.- New CsrfMiddleware features
(9554)– Features automatic exceptions for known AJAX and decorator for manual exceptions
- New CsrfMiddleware features
- Iterate over Hidden Fields
(9569)– Added a way to iterate over hidden/visible fields in a form. Useful for manual form layout.
- Added permanent option to simple.redirect_to
(9594)– Added a ‘permanent’ argument the simple.redirect_to() generic view. It’s True by default, to match existing behavior. If set to False, the redirect will be a 302 instead of a 301.
Community Catchup (35:29)
- Get User from session key in Django – So, you get an email from your Django app informing you of a server exception. Ever want to find out who the user is? Maybe do a little help desk support? This post details reverse engineering the sessionID provided in the exception email details and then querying Django’s Session tables and User table to pull back the related User.
- django-extensions – One of the comments also noted that the popular django-command-extensions project provides a nice utility management command for this already – ‘print_user_for_session’.
- Randomized Include Tag – Template tag used for randomizing templates to include. This is especially useful if a section of your site rotates content at random that isn’t database driven.
- DjangoTracker – Loren Davie, co-founder of Django-NYC, created a nice utility for Twitter users interested in keeping track with Django trunk. Go follow djangotracker now and stay up to date!
- Django-axes – Keep track of failed login attempts – Keep track of failed login attempts in Django-powered sites. Two nice customizations that can be configured in your settings file are:
- LOGIN_FAILURE_LIMIT: The number of login attempts allowed before a record is created for the failed logins. Default: 3
- LOGIN_FAILURE_RESET: Determines whether or not the number of failed attempts will be reset after a failed login record is created. If set to False, the application should maintain the number of failed login attempts for a particular user from the time the server starts/restarts. If set to True, the records should all equate to LOGIN_FAILURE_LIMIT. Default: True
- Django-positions – A Django model field for managing user-specified positions.
- models with order – Justin Lilly tweeted he found a similar sortable code snippet just the other day. This solution, though, implements “up” and “down” icons in the admin to promote sorting in the UI, which could be kinda sweet.
- Deploying Django with Fabric – Fabric has been getting a lot of love recently, and for good reason – it’s a simple yet powerful solution for deploying your apps, written in python, as their slogan says “simple pythonic deployment”. Will Larson
- We mentioned Django-Fabric , a thin layer over the fabric deployment tool, during episode TWiD episode #40
- Simple & Easy Deployment with Fabric and Virtualenv – LincolnLoop discusses using a combination of Fabric and VirtualEnv for its project but also released the Fabric files on Github as lincoln-loop-deploy – An easy-to-use Fabric script for deploying Python projects.
- djangolinks – a new Twitter account that posts django related links.
Tip of the Week (56:27)
render_to_response can take a list of templates to render in order of availability. This means it will render the first one that is present.
The admin uses this to let the user override templates in their TEMPLATE_DIRS paths.
Thank You! (1:02:06)
- Watching Cars - – Special music by Texas duo brothers David and Collin Gouldin with their band Watching Cars. Watching Cars is a unique blend of homespun roots and understated pop that will have its listener unknowingly whistling melodies the next day. David is also involved with Pegasus News, is a Django fan and listens to the show. Check out their music, it’s some really great stuff.
Additional Links
- The Show
- Brian Rosner
- Kevin Fricovsky
- Monty Lounge Industries – Kevin’s web strategy, design, and development company.
- How I Work Daily – Kevin’s blog.
- Michael Trier
Comments - 11 people have already said something. Join the discussion.
Andreas said…
Congratulations for 1 year on twid. I can't thank you enough for all great episodes.
Lee said…
This independent django component use poll** is a little beside the point. Apart from being asked in a bad way, that'll skew results, it's being asked on a DJANGO site. Which kind of ignores the point of thinking of ourselves as part of a wider community than just django, no?
Rock Howard said…
Re your new poll: I used Spyce before Django. Spyce is an interesting but rarely used alternative python web framework so I am not surprised that you didn't include it in the poll. However I am surprised that you didn't mention Zope/Plone as one of the possible prior web frameworks.
omtv said…
Wonderful job and it's so good to have twid around!
jamei said…
I wasn't using frameworks before I found django - perhaps 'None' should be on the poll.
huxley said…
I was doing both straight PHP and Java (with WebObjects) before migrating to Django, so in my case a multiple selection widget would have been good. I never really clicked with PHP so I selected Java on the survey.
BrettH said…
Like Rock Howard I can't believe you didn't put Zope or a generic Other on the list. Those poor long suffering zopistas. Much as I had to ditch it in the end, I still consider Zope 'THE' python web framework by which others are measured.
MW said…
How about an 'Other' option? I haven't been using a framework before, but I did my web programming in perl before. Yeah, I know.
Chris Clarke said…
Hi
I previously used spyce which looked pretty good compared to the alternatives in 2004/2005. I still have a couple of spyce sites that i still support and its a real nightmare!! All the features in the 2.1 version have serious "gotyas" and the 2.2 version is so riddled with bugs that it will never be released.
Shows the dangers of relying on a a "one-man" project
Indeed I'm writing this taking a break trying to debug an error in an active tag which is kinda like an include template tag
What a mess!!
All praises to django
Srik said…
Congrats on 1yr mark and looking forward for more to come :)
Also thanks for updating us with trunk for those who are using stable release.
Ashcrow said…
You guys might like Func (https://fedorahosted.org/func/) which sounds pretty similar to Fabric. I use Func with a few things and committed the start of a Django module upstream.