Living on the Edge

This Week in Django 38 - 2008-09-22

Posted on September 24, 2008

This Week in Django is a weekly podcast about all things Django.

This week we do a DjangoCon retrospective, feature a special live interview with Pownce developers Leah Culver and Mike Malone, discuss a few source commits and some cool projects from the community.

Check it out…

DjangoCon - Enjoy the Fun

Posted on September 16, 2008

Last weekend I had the unique privilege to attend and participate in DjangoCon, the first international Django based conference. It was a wonderful experience and I had the great opportunity to meet a lot of incredibly smart people. I was especially excited to be able to participate by Moderating two discussion panels and doing the This Week in Django show live. The whole thing was held at Google, which is just amazing, and they recorded all of the presentations and have made them available. I encourage you to enjoy the fun. note, if you want higher quality videos watch them on YouTube and select “watch in high quality”. I participated in the following:

Panel: Django Technical Design

A technical design discussion panel featuring core developers: Jacob Kaplan-Moss, Adrian Holovaty, Simon Willison, James Bennett, Malcolm Tredinnick. This one was a ton of fun and I only wish we had more time. I had a bunch of questions that I did not get the opportunity to ask, and others that were covered in prior keynotes so I thought it was best not to harp on them any longer.

Panel: Schema Evolution

A panel discussion on Schema Evolution and three popular approaches to this problem for Django. Featured project leads Simon Willison (dmigrations), Russ Keith-Magee (django-evolution), Andrew Godwin (South). This panel had some spirited discussion on schema evolution and their different approaches. It seems that there are enough similarities that we will hopefully see some collaboration among the projects.

TWiD Live

Michael Trier & Brian Rosner do a live presentation of the This Week in Django podcast. We were a bit nervous about this one since in our regular weekly podcast we have an opportunity to stop and start or do certain item over again. With the exception of a couple of minor mistakes it turned out great and was tons of fun. I was quite surprised by the number of questions that were asked. The only bummer about this one right now is that it cuts off the intro and the outro, but we’re trying to get Google to restore that.

Django 1.0

Posted on September 03, 2008

Well it’s finally here. Django 1.0 is the moment a lot of us have been waiting for. It’s a very exciting moment for the Django team but even more so for the development community at large. It represents a huge milestone in the web framework space.

Django, without a doubt, brings forth some incredibly innovative ideas that help take web development to the next level. So I am pleased to be a part of this, in some small way, but also looking forward to what’s next for Django and its popularity as a web framework.

If you haven’t had the pleasure to experience Django I encourage you to do so now. You’re programming mind will thank you for the experience.

This Week in Django 36 - 2008-08-31

Posted on September 03, 2008

This Week in Django 36 has been posted. It’s a great episode with our special guest James Bennett. Hear James talk about the book, the blog, speaking, and a whole lot more.

This Week in Django 35 - 2008-08-24

Posted on August 26, 2008

This Week in Django 35 has been posted. Don’t miss it. We catch up with Robert Lofthouse, Chairman of DjangoCon and EuroDjangoCon.

Django Docs Refactor

Posted on August 23, 2008

Django documentation has been refactored (Changeset 8506) using the excellent Sphinx – Python documentation generator. This is the same package used to generate the new Python documentation Check out the new docs at http://docs.djangoproject.com/. Now I have to go and update all my shortcut snippets. Thanks go especially to Jacob Kaplan-Moss and numerous contributors for all of their hard work on this one.

This Week in Django 34 - 2008-08-17

Posted on August 18, 2008

This Week in Django 34 has been posted.

This week we discuss Django 1.0 Beta 1, a bunch of source commits, some cool projects from the community, and a tip of the week.

Django 1.0-Beta 1

Posted on August 14, 2008

Just released is Django 1.0-Beta 1. This is another huge milestone in the push towards Django 1.0. This also means that we are likely to see a more stable trunk, so it looks like it’s heads down on Django once again. Check out the release notes for more information.

But the coding never stops. Tomorrow begins the Release Candidate sprint in Austin, TX and via IRC on freenode #django-sprint. Jump in and squash bugs.

I want to thank all of the contributors for their very hard work.

This Week in Django 33 - 2008-08-10

Posted on August 14, 2008

This Week in Django 33 has been posted.

This week we discuss the NEW This Week in Django site, a bunch of source commits, and some cool projects from the community.

All show notes from now on will be on the new This Week in Django dedicated site.

This Week in Django Delayed

Posted on August 12, 2008

This Week in Django will be delayed this week. We hope to get it out by tomorrow evening. We have been experiencing technical difficulties. Thank you, and now back to our regular scheduled program…

Django 1.0-Alpha 2

Posted on August 08, 2008

Django 1.0 Alpha 2 was just released. This release adds in GeoDjango, Intermediary models and file storage refactor. Grab a copy and test it out.

File Storage Refactoring in Django

Posted on August 08, 2008

With Changeset 8244 we now have File Storage refactoring in the Django trunk. This was one of the big Version 1.0 items and helps get Django closer to the goal line. Congratulations are in order to Marty Alchin for all of his hard work over umpteen months. I really thought it would never make it. :)

This Week in Django 32 - 2008-08-03

Posted on August 05, 2008

This Week in Django is a weekly podcast about all things Django.

This week we have a very special guest, Justin Bronn, creator of GeoDjango the GIS branch of Django. We also discuss a few source commits, some cool projects from the community, and the Tip of the Week.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (53.6 MB, 1:08:44, AAC)

MP3 Edition (47.3 MB, 1:08:44, MP3)

OGG Edition (34.4 MB, 1:08:44, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (0:48)

Interview – Justin Bronn (5:11)

Justin Bronn is a computer scientist and third-year law student at the University of Houston who enjoys studying legal topics related to intellectual property and spatial law. Prior to creating GeoDjango, Justin worked as a patent engineer for an intellectual property boutique in Houston and developed scientific data analysis applications for the Southwest Research Institute in San Antonio.

CartoAnalytics is Justin Bronn’s consulting company. CartoAnalytics provides innovative solutions to harness the power of your geospatial data.

Tracking Trunk (39:51)

Community Catchup (48:10)

  • Admin Image Widget Pete Baumgartner, LincolnLoop, posted this nice snippet that displays an image instead of a file path if the current file is an image. If you read the comments, another user updated the code generating the thumbnails to use the popular django open source project sorl-thumbnail
  • How Django is good for SEO Patrick Beeson is a project manager for E.W. Scripps Interactive Newspaper Group in Knoxville, TN. In the past Patrick has published a few good django related posts but this was is of interest because it discussed one of the many “out of the box” application benefits the django toolset provides.
  • django-assets – Asset management for Django. Automatically compresses javascript files. Supports the following filters: jsmin, jspacker, csstidy, cssutils, yui_js, yui_css, gzip, cssrewrite.

Tip of the Week (1:00:50)

Use decorator_from_middleware to create a decorator that can be used in your views, which wraps up a middleware class.


from django.utils.decorators import decorator_from_middleware 
from django.middleware.middlewaremodule import MiddlewareClass 

decoratorfunc = decorator_from_middleware(MiddlewareClass)

This code is not documented but added as part of cache reworking. See this thread for more information:

Thank You! (1:03:19)

This Week in Django 31 - 2008-07-27

Posted on July 29, 2008

This Week in Django is a weekly podcast about all things Django.

This week we discuss Satchmo, the Django open-source E-Commerce application with Chris Moffitt and Bruce Kroeze. We also look at a few source commits and some cool projects from the community.

Apologies for some of the microphone noise.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (89.3 MB, 1:52:43, AAC)

MP3 Edition (77.4 MB, 1:52:43, MP3)

OGG Edition (63.3 MB, 1:52:43, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (0:00)

Interview – Satchmo Developers (8:33)

Satchmo is a Django based E-Commerce solution.

Tracking Trunk (1:02:46)

Community Catchup (1:08:41)

  • Semantic Django – David Larlet’s website where he archives a collection of open source semantic reusable django apps including such technologies as OpenID, OAuth, Microformats, RDF, FOAF, REST, Atom, Snippets and Patchs.
  • Automating tests in Django – Great post by Eric Holscher that goes through how to create integration tests for your Django applications in an automated way through the use of a Middleware that logs the test creation output to a file.
    • Automating Test Creation – Empty’s feedback on it.
    • Testmaker .002 – Eric updates us with new additions to his open source test project including adding a management command, making it simple to add TestMaker to your project just but adding a reference to INSTALLED_APPS.
  • Django Subdomains – Every have the requirement to implement customized subdomains in your django app, mapping to a model key? It makes for clean, personal, simple to remember url (ex. username.yourappname.com). If you’ve ever used the popular Basecamp web application you’re familiar with their URL structure – [companyname].projectpath.com. This tutorials details how you can do the same as well as references other posts who attempted the same thing, and issues they all ran into along the way.
  • Creator/updater fields for admin – Peter Baumgartner, LincolnLoop, recently got his hands dirty customizing a newforms-admin implementation and created a a customized ModelAdmin class that sets fields for models saved in admin corresponding to the user that created the object and the user that last updated the object. Seems trivial for the currently edited model but the catalyst for this was making sure inlines received the same auditing synchronization. He also leverage JQuery to provide additional client side logic.

Thank You! (1:46:38)

  • NERD_Tree – Excellent VIM plugin that gives a project drawer like behavior.

Django Gets Intermediate Models

Posted on July 29, 2008

With Changeset 8136 Django gains the ability to specify intermediate models in a declarative way. This makes it possible to have extra attributes on your many-to-many join table. Check out the docs for more information.

I’ve been watching this one for almost a very long time and I’m glad to see it get in. Special thanks go to Eric Florenzano and Russell Keith-Magee

Automating Test Creation

Posted on July 24, 2008

Eric Holscher just posted a very nice article titled Automating tests in Django. The post goes through how to create integration tests for your Django applications in an automated way through the use of a Middleware that logs the test creation output to a file. It’s a creative approach and certainly very interesting. One additional benefit is that Eric created a screencast to go along with the post that is excellently done.

There is one thing about this approach to testing that doesn’t quite sit right with me and that’s that it seems like the testing process is backwards. If you’re creating tests based on what you have how are you possibly going to cover what’s specified but not implemented properly? It’s the same reason I’m not a fan of doctests. I think they encourage the wrong behavior, especially when often the output your matching to is so complex that the tendency is to just copy and paste from live results. I recognize that a lot of people don’t feel the same way, and perhaps I just need to give the idea more time to sink in.

I really appreciate all of the screencasts that are starting to show up within the Django community. I think it’s a vehicle that a lot of people enjoy and learn well from. I know that I’m certainly looking foward to more screencasts from Eric.

Replacing Django's ORM with SQLAlchemy

Posted on July 23, 2008

Will Larson just created a post titled Replacing Django’s ORM with SQLAlchemy that covers using SQLAlchemy with a Django project. It’s a great write-up, and generally what Django folks are referring to when they say, “of course you can use SQLAlchemy with Django.” I think Will does a good job of stepping you through the important bits.

One thing I appreciate is that the post hints at some of the negatives of doing something like this. You lose things like generic views, all contrib apps including the admin, most of the management commands, and some smaller pieces that are embedded in various parts of the framework. Tread this way cautiously.

Another item in the post that got my attention was when Will mentioned the following in reference to the possibility of doing a full drop in replacement for the Django ORM, essentially allowing you to use fully the Django bits alongside of the SQLAlchemy pieces:

This tutorial won’t build that Frankenstein, since it’s only interested in exploring the loose coupling aspect, but it wouldn’t be prohibitively difficult to do so. Although, it would be awkward in some regards.

Well I, and others, have been building “that Frankenstein” for some time now with a project we call Django-SQLAlchemy. There’s also a somewhat defunct project called Tranquil that is a hybrid between what Will demonstrates and what we’re trying to do with django-sqlalchemy.

I’m not sure whether or not these projects are “awkward” or “Frankensteins,” but I can assure you thus far they have been prohibitively difficult, as we see no full implementation for a drop-in replacement still today. Getting the initial stuff in place is pretty darn easy, but as you get into it there are lots of little edge cases that complicate things significantly.

I want to thank Will for the great post. I think he does a great job of talking about the strengths of SQLAlchemy, and hopefully people will be inclined to experiment with the idea of using SQLAlchemy in addition to, or instead of, Django’s ORM.

TWiD Community Evangelist

Posted on July 23, 2008

As we mentioned on This Week in Django 30 Kevin Fricovsky will be joining the podcast as a Community Evangelist. If you’re wondering what that’s all about and how Kevin fits into the show, check out his detailed post on the subject. Both Brian Rosner and I are extremely pleased to have Kevin’s help and support.

This Week in Django 30 - 2008-07-20

Posted on July 21, 2008

This Week in Django is a weekly podcast about all things Django.

This week we discuss the NewForms-Admin merge into Trunk, DjangoCon, a few source commits, some cool projects from the community, and the Tip of the Week.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (41.8 MB, 49:31, AAC)

MP3 Edition (34.1 MB, 49:31, MP3)

OGG Edition (27.9 MB, 49:31, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (0:47)

Tracking Trunk (15:04)

Community Catchup (26:16)

  • Kevin Fricovsky – joins the This Week in Django team as Community Evangelist. Kevin will be working to produce the show, contacting guests, gathering news items, coming up with ideas. Kevin has been doing this work regularly anyway so it’s great of him to team up with us to help out the program:
  • PyOhio – Reminder that this free one day conference is in Columbus, OH on July 26, 2008.
  • Twitter Search – via Kevin Fricovsky using the new Twitter Search capability to track all tweets about django.

Tip of the Week (38:32)

This tip comes to us via Ben Jao Ming in his post Django auto-translation of field values.

If you need to translate content in a field then gettext is not going to help you out. Since you can create your own custom fields it’s easy to wrap a CharField with the translation behavior:


from django.db import models
from django.utils.translation import gettext_lazy as _

class AutoTranslateField(models.CharField):
    __metaclass__ = models.SubfieldBase
    def to_python(self, value):
        return str(_(value))

Just add whatever translations you know of to the locale file and run compilemessages.

Thank You! (42:45)

Django 1.0-Alpha

Posted on July 21, 2008

In the ongoing march to Version 1.0, the Django project just tagged and bagged the 1.0 Alpha version with Changeset 8037. I encourage everyone to grab the tarball or svn up and start banging on the latest and greatest code.

update: Django 1.0 alpha release notes

update: Django 1.0 alpha released! blog post

NewForms-Admin Migration Screencast!

Posted on July 21, 2008

Brian Rosner just released a new screencast and blog post, newforms-admin Migration and Screencast, that walks you through how to get started with migrating to NewForms-Admin from your existing trunk based code. The screencast and accompanying blog post are very well done. It’s great to get this kind of helpful information, especially from someone that knows so much about the internals of the code.

I highly encourage everyone to check it out, especially if you’re on the fence on whether or not the conversion is worth it. Brian shows how easy it is to get started.

DjangoCon Schedule Available

Posted on July 20, 2008

Robert Lofthouse just announced that the DjangoCon schedule is available. There are a ton of exciting speakers and topics being presented. It’s going to be a great time and I’m looking forward to seeing everyone there. I am curious if people will be extending the conference into the following week and if sprints are being planned. I’d like to make the most of it.

NewForms-Admin Lands in Django Trunk

Posted on July 18, 2008

Brian Rosner just now, with Changeset 7967, merged the NewForms-Admin branch of Django into Trunk. This is a huge step forward in the push to version 1.0. I want to personally thank all of the numerous contributors that have made NewForms-Admin possible. It’s been an enormous amount of work, and I am so appreciative. Thanks!

update: Read the release post.

This Week in Django 29 - 2008-07-13

Posted on July 15, 2008

This Week in Django is a weekly podcast about all things Django.

This week we have a special guest, Kevin Fricovsky, that joins us as we talk about DjangoCon, EuroPython, a few source commits, some cool projects from the community, and the Tip of the Week.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (74.2 MB, 1:31:20, AAC)

MP3 Edition (62.8 MB, 1:31:20, MP3)

OGG Edition (51.5 MB, 1:31:20, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (3:38)

“DjangoCon 2008. Venue: Googleplex, San Francisco Bay Area. Dates: 6th and 7th Sept. Official post will be on djangoproject.com soon.”

Tracking Trunk (14:27)

Branching and Merging (34:18)

Community Catchup (47:27)

  • django-treemenus – Very cool application by Julien Phalip that makes it easy to add tree menus to your Django app and manage the structure dynamically from the customized admin interface. View the 0.4 release post for more information.
  • First Two Django Screencasts – Eric Florenzano never sleeps. His first foray into screencasts are quite impressive. He covers: 1. Setting up a Django Environment 2. Using Django-Pagination

Tip of the Week (1:10:41)

Mike Axiak offers the following tip for getting started with contributing to Django source code.

1. Find a closed ticket that interests you. 2. Take a look at a closed ticket, but not the patch. 3. Check out the revision prior to the one that closed the ticket. 4. Write a patch for Django with your own implementation. 5. Compare your patch with the committed patch and try to learn from the differences.

Once you’re comfortable do it for real.

Thank You! (1:23:24)

  • Kevin Fricovsky

DjangoCon Officially Announced

Posted on July 13, 2008

There’s been lots of discussion and hints over the past several days about a forthcoming Django based conference called DjangoCon. The official announcement was just released. I’ve always been fond of small intimate group settings and this one will certainly be that with only 200 attendees allowed to participate. I only hope that I get one of the coveted spots.

Cloud27 - A Social Network

Posted on July 12, 2008

This morning I got my first glimpse of what will become Cloud27, featuring a sporty design by Greg Newman, and I already like what I see. Cloud27 is a new social network based on Pinax, a Django reference application for reusable applications.

So if there’s Pinax, why Cloud27? Well Pinax is where all development and new ideas happen. Pinax is project intended to provide a starting point for websites. Cloud27 will actually be focussed on building out on the base of Pinax and expanding it into a kick-ass social network application.

To find out a whole lot more about reusable applications and Pinax, I highly recommend a listen to This Week in Django 24, featuring Pinax / Cloud27 founder James Tauber.

I’ll be keeping an eye on Cloud27.

No TWiD This Week

Posted on July 07, 2008

Apologies to all but there will be no This Week in Django podcast this week. Enjoy the week off and we look forward to seeing you all next week on TWiD Live.

Callcast with Jacob Kaplan-Moss

Posted on July 07, 2008

Kevin Fricovsky at the HIWD (How I Work Daily) blog just posted a very interesting callcast with Jacob Kaplan-Moss, one of Django’s core developer. In the callcast, Jacob discusses a planned DjangoCon 2008 conference to be held in the San Francisco Bay area. The idea of a conference centered around Django sounds very exciting. I highly recommend that you give it a listen.

This Week in Django 28 - 2008-06-30

Posted on July 01, 2008

This Week in Django is a weekly podcast about all things Django.

This week we talk about quite a few source commits (kicking-ass), some cool projects from the community, the Tip of the Week, and a question from the IRC.

Let us know if downloads are better for those of you in Europe.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (50.3 MB, 1:01:06, AAC)

MP3 Edition (42 MB, 1:01:06, MP3)

OGG Edition (32.9 MB, 1:01:06, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News

Malcolm Tredinnick is back!!!

Tracking Trunk (1:08)

Community Catchup (19:28)

  • Kss in DjangoKSS is a javascript framework that aims to allow Ajax development without javascript. It uses stylesheets with CSS-compliant syntax to setup behaviours in the client and a set of well-defined commands that are marshalled back from the server to manipulate the DOM.

Tip of the Week (43:49)

Ever need to reorder the fields on your Model Form?


class TranslationForm(BookForm):
    translator = forms.CharField(max_length=40)

    def __init__(self, *args, **kwargs):
        super(TranslationForm, self).__init__(*args, **kwargs)
        self.fields.keyOrder = ['title', 'author', 'translator', 'publisher', 'copyright']

IRC Ad Nauseam (47:10)

Django IRC FAQ

Backwards Incompatible Changes Information

Charlie O’Keefe say, “I’ve gotten into designing restful URL schemes, basically organizing a web app around resources. Learning Django I was frustrated to find that nothing seems to be done this way. Is there any tool that can help with that?”

Thank You! (50:58)

Words Matter

Posted on June 24, 2008

You have to word your invitations carefully. Depending on which way this goes, I might just cozy up to a nice glass of wine.

Django Code Swarm Visualization

Posted on June 24, 2008

In the closing remarks of This Week in Django 26 Brian Rosner pointed out a code swarm visualization created for Python as well as a couple of other open source projects. Well, in typical Brian fashion, he couldn’t leave well enough alone, so he created a wicked cool Django Code-Swarm Visualization. Definitely check this out. Thanks Brian.

This Week in Django 27 - 2008-06-22

Posted on June 23, 2008

This Week in Django is a weekly podcast about all things Django.

This week we talk about the Django Software Foundation, some source commits, some cool projects from the community, a Tip of the Week. and a couple IRC items. It’s a packed show.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (55.8 MB, 1:08:08, AAC)

MP3 Edition (46.8 MB, 1:08:08, MP3)

OGG Edition (38.5 MB, 1:08:08, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

SPONSOR: This Week in Django is brought you by Justin Lilly, who according to all historic accounts, once scissor kicked Angela Landsbury. Thank you Justin.

Big News (2:18)

New foundation for Django – Lawrence-Journal World announces new Django foundation and code commits change license ownership.

Tracking Trunk (5:02)

Branching and Merging (9:50)

Community Catchup (15:57)

  • DebugFooter Redux – Last week we talked about Andreas Marr very cool Django Snippet to add debug information into the footer of each webpage. This week he did it one better based on some suggestions from our program. Now that’s what I call Podcast Driven Development™.

Tip of the Week (43:22)

This tip comes from Alexander Solovyov in his blog post Render To Improved.

Sometimes you want to return a RequestContext from a view. One way to do that is to specify the response code using a decorator.


@render_to('mytemplate.html')
def myview(request):
  return ({'id': 1, 'name':'empty'})

# example with override
@render_to('mytemplate.html')
def myview(request):
  return ({'name':'empty'}, 'override.html')

# python 2.3 example with override
def myview(request):
  return ({'name':'empty'}, 'override.html')
myview = render_to(myview, 'mytemplate.html')

You can also return a tuple where the second item is a string that overrides the default template specified in render_to.

IRC Ad Nauseam (51:11)

Django IRC FAQ

Backwards Incompatible Changes Information

What’s the difference between Abstract Base Classes and Multi-Table Inheritance?

Abstract Base Classes are where you provide a base class, like Person, and then a derived class like Employee. Django will create a single database table for the Person model that contains the combined fields from both the base and derived classes.

Multi-Table Inheritance also has the base and derived class but at the database level you end up with two tables: one for the base class and one for the derived class, with a one-to-one field added in to connect the two.

Again, we highly recommend the excellent post by Kevin Fricovsky that we mentioned in Community Catchup. Plus, as always, the excellent Django documentation.

Is there a way to pass the filter arguments as string to the QuerySet?

QuerySet parameters are standard Python keyword arguments, and can use standard keyword argument expansion.


Post.objects.filter(datetime__year=2008)

Post.objects.filter(**{'datetime__year': 2008})

Thank You!

Hacking Pythons

Posted on June 23, 2008

Someone is very creative. I love it!

“What the hell is going on? This is fucking incredible.” Jacob Kaplan-Moss said. Kaplan-Moss is the chief architect of Django and said nothing like this had ever happened before. “They’re all naked, and these chicks don’t shave anything!”

Werkzeug Debugger in Django

Posted on June 21, 2008

A new feature to come to the Django-Command-Extensions project is the implementation of a new management command called runserver_plus. For now the “plus” part means that I’ve replaced the standard Django traceback pages with the Werkzeug Debugger traceback page in it’s place.

Getting Started

This item requires that you have the Werkzeug WSGI utilities installed, in addition to the django-command-extensions app.

To get started we just use the `runserver_plus` command instead of the normal `runserver` command:


$ python manage.py runserver_plus

 * Running on http://127.0.0.1:8000/
 * Restarting with reloader...
Validating models...
0 errors found

Django version 0.97-newforms-admin-SVN-unknown, using settings 'screencasts.settings'
Development server is running at http://127.0.0.1:8000/
Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
Quit the server with CONTROL-C.

Note: all normal runserver options apply. In other words, if you need to change the port number or the host information, you can do so like you would normally.

Using

Whenever we hit an exception in our code, instead of the normal Django traceback page appearing, we see the Werkzeug traceback page instead.

Along with the typical traceback information we have a couple of options. These options appear when you hover over a particular traceback line. Notice that two buttons appear to the right:

The options are:

View Source

This displays the source below the traceback:

Being able to view the source file is handy because you are able to get more context information around where the error occurred. The actual traceback areas are highlighted so they are easy to spot.

One awkward piece about this is that the page is not scrolled to the bottom. At first I thought nothing was happening because of this.

Interactive Debugging Console

When you click on this button a new pane will open up below the traceback line you’re on. This is the money shot:

An ajax based console appears in the pane and you can begin debugging away. Notice in the screenshot above I did a print environ to see what was in the environment parameter coming into the function.

Summary

I’ve only been using the Werkzeug debugger on my Django projects for a day now. But I’m loving it. I encourage you to check it out. Plus if you’re not a current Django-Command-Extensions user, you’re going to find tons of really cool additions in there.

WARNING: This should never be used in any kind of production environment. Not even for a quick check into a problem. I cannot emphasize this enough. The interactive debugger allows you to evaluate python code right against the server. You’ve been warned.

This Week in Django 26 - 2008-06-16

Posted on June 17, 2008

This Week in Django is a weekly podcast about all things Django.

This week we talk about the Django 1.0 Roadmap, EuroPython Sprint, tons of source commits, great stuff happening in the NewForms-Admin branch, some cool projects from the community, and the Tip of the Week.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (32.4 MB, 55:28, AAC)

MP3 Edition (38.1 MB, 55:28, MP3)

OGG Edition (30.8 MB, 55:28, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Big News (1:37)

EuroPython Django Sprint – We are holding an official Django sprint, July 10th until saturday July 12th, during the EuroPython conference. Join us in the push to 1.0.

Tracking Trunk (9:19)

  • Fixed serialization for multi-model inheritance (7600)
    • Serializers were including all superclass fields in their output. Now only local fields are included.
    • Implicit OneToOne? primary keys were not correctly added to the metamodel, so they were always marked to be serialized, even though they were primary
    • Model saving was too aggressive about creating new parent class instances during deserialization. Raw save on a model now skips saving of the parent class.

Branching and Merging (17:06)

Community Catchup (29:58)

  • Django Dash Results – Congratulations to all the participants. Check the results for information on all the winners.
    • 1st Place – Benjamin Pollack and Tyler Hicks-Wright – Their site was a code review site with Mercurial integration.
    • 2nd Place – Eric Florenzano and Tony HauberFeedalizer is a syndication feed aggregation based on popular feeds ranked by users.
    • 3rd Place – Justin Lilly and Jannis Leidel – A site connecting developers & translators with rankings for translators and groupings.
  • A Better Serialization Framework – A series of interesting posts by fiam on creating what he calls a better serialization framework.

Tip of the Week (41:59)

If you have a template tag that you want to automatically load into context for all of your templates, you can take the same approach Django does with the built-in template tags.

This must be done early on in the load process, so in your __init__.py for the app or project, just do:


from django.template import add_to_builtins
add_to_builtins('template_utils.templatetags.generic_content')

Thank You! (44:56)

  • Code Swarm – Python – amazing swarm representation of Python code commits over years of time. You have to see this!

This Week in Django 25 - 2008-06-08

Posted on June 09, 2008

This Week in Django is a weekly podcast about all things Django.

This week we talk about a few source commits, a discussion about releases, Some cool projects from the community, and the Tip of the Week.

We liked this one so much we decided to record it twice!

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (42.9 MB, 52:57, AAC)

MP3 Edition (36.4 MB, 52:57, MP3)

OGG Edition (28.3 MB, 52:57, Vorbis)

The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.

Feeds Available

iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.

iTunes Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

Regular RSS Feeds

This Week in Django – AAC Edition

This Week in Django – MP3 Edition

This Week in Django – OGG Edition

Give Us Feedback

Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__ thisweekindjango.com.

Show Notes

Tracking Trunk (4:05)