Django gotchas

by shabda on November 11, 2009

This is announcement about our new work, Django Gotchas, a teeny tiny ebook about commonly occurring gotchas with Django. Here is the readme copied from the project.


Django-gotchas is a collections of gotchas which happen commonly when you are working with Django. They are some errors which I have made commonly or seen others do, these are not the errors which happen because they are hard to reason about, these are those errors which hapen when you close your eyes for a moment when coding.


This is still very much a work in progress, released in the spirit of release early, release often. Click here to get it, or fork it on Bitbucket

In Other news

Related posts:

  1. Django design patterns
  2. Better Python package management using source and version control systems

6 Comments 4 Tweets

{ 11 comments… read them below or add one }

1 Jonathan Biddle November 12, 2009 at 12:43 pm

Looks good!

There’s a small typo on the urls page: url(‘^edit/(?P[w-]+)/$’, edit_view, ) should be: url(‘^edit/(?P[\w-]+)/$’, edit_view, )

2 free July 8, 2010 at 12:09 pm

These don’t appear to be Django gotchas so much as Python gotchas.

3 tehpoopsmith November 12, 2009 at 9:44 am

Didn’t know that in 1.1 you don’t have to wrap template for loops in if’s anymore… just do a for on the .all {% for comments in post.comment_set.all %}

This comment was originally posted on Reddit

4 RedSpikeyThing November 12, 2009 at 9:45 am

These don’t appear to be Django gotchas so much as Python gotchas.

This comment was originally posted on Reddit

6 mclin November 12, 2009 at 11:09 am

> these are not the errors which happen because they are hard to reason > about, these are those errors which hapen when you close your eyes for a > moment when coding. I find I get gotcha’d more because that it doesn’t behave the way I’d expect it to based on my experience with other web frameworks. I find I get gotcha’d surprisingly frequently with Django. … Just got to get over that hump..

This comment was originally posted on Reddit

7 orangesunshine November 12, 2009 at 11:51 am

These don’t necessarily seem to be gotcha’s as mis-understandings of either python, regex, or django basics. To me a gotcha would be something like how there isn’t any easy way to do many-to-many fields as check-boxes… or other things in the otherwise awesome django framework that are exceedingly difficult to do when they shouldn’t be (though this is relatively rare). These are more or less errors than novices make. Not necessarily "gotcha’s" or shortcomings in the framework itself.

This comment was originally posted on Reddit

8 paddie November 12, 2009 at 5:22 pm

yeah, and there’s the {% empty %} thing too, for when the list is empty.. very nice and faster than the old way..

This comment was originally posted on Reddit

11 jigs_up November 15, 2009 at 11:54 pm

Django….. to each their own, i suppose.

This comment was originally posted on Reddit

Leave a Comment

Additional comments powered by BackType

Previous post:

Next post: