Weblog

Django roundup: August 12

  • Django news:
    • Browsing through the repository checkins for trunk, I noticed that Malcom and Adrian had checked in over 50 patches for mostly bug-fixes to both code and documentation. If you’ve been waiting for a specific fix, take a look through the list. Thanks to everyone involved in working to get those 50+ patches integrated into trunk!
  • New Django sites of note:
    • Fredrik Lundh, maintainer of effbot.org, is currently porting over the "zone" (where things like PIL, Tkinter, and more are documented) to Django: “All in all, the zones at effbot.org currently contain around 2,000 documents, plus a couple of hundred user comments. Until now, the zone has been served as static HTML, generated and maintained using an increasinly disorganized collection of CGI scripts and off-site tools. Given that we moved pythonware.com to Django late last year, it’s about time I did the same to effbot.org.” Fredrik has written up his experiences during this process in a document which I highly recommend.
  • Code snippets and projects:
    • Maximillian Dornseif has posted a method for determining code-coverage of your Django project’s tests without having to alter any of the Django internals: “Siddharta Govindaraj has a blogpost on integrating Django with coverage.py to check what your tests actually test. Siddharta patches Django to archive his goals. But you can get the same results without fiddeling with Django’s Source-Code. Django now comes with a TEST_RUNNER setting which let’s you switch your testing engine.
    • Massimo Scamarcia sent me an email about his blog post that explains how you can create a basic Django-powered photo gallery in only a few minutes.
    • Michael Trier points us to a few different techniques for peeking inside Django’s ORM to see what database queries your application is generating.
    • Ross Poulton has written a blog post detailing how to configure and use subdomains with your Django project: “As a part of my previously mentioned upcoming bridal gift registry project (which, by the way, performed outstandingly in it’s most important private beta ever – my own wedding) I’m giving each user (in this sense, a user is a couple close to getting married) their own subdomain off of the main website – instead of having a URL to their registry like http://yourdomain.com/registries/view/?id=1048 there are beautiful URL’s like http://couplesnames.yourdomain.com.
    • Do you ever find yourself writing the same lines of code at the top of your views? Nathan Ostgard did and he’s such a dedicated DRY’er that he wrote a specialized middleware to clean up his code: “Having the same few lines at the top of every function in makes me feel dirty. You can clean this up with a Middleware class, replacing foo_id with the actual object before calling the view.” If you find yourself in the same situation as Nathan, head over to his blog, read his post, and hopefully make use of his middleware!

If you have any tips, project announcements, or generally interesting Django news, email me at clintecker+djangotips@gmail.com.

Posted by Clint Ecker on August 12, 2007

Comments

Douglas Jarquin August 13, 2007 at 1:51 a.m.

Love the breakdown, thanks Clint.

Alberto August 13, 2007 at 1:56 a.m.

Another great news:
http://simonwillison.net/2007/Aug/11/...
http://packages.ubuntu.com/gutsy/pyth...

Lorenzo August 13, 2007 at 7:58 a.m.

Clint, you rock!

L.

pk11 August 13, 2007 at 8:15 a.m.

thanks clint for the update!

Powerlord August 14, 2007 at 3:40 a.m.

Fredrik:
Repeat after me: Embedding images in HTML documents using data urls is bad.

Not only do you lose performance now by having to extract them because IE and Firefox don't support them, but even if they did support them, they bloat your documents by not being cacheable static media files.

Fredrik August 14, 2007 at 6:08 a.m.

"Embedding images in HTML documents using data urls is bad."

Nobody's doing that. Try again.

Fredrik August 15, 2007 at 5:16 a.m.

(to clarify, I'm using data URL:s in source documents and in the intermediate format that's stored in the database, not in the HTML that's being delivered over the wire. by doing some preparations when the source documents are added to the database, I can move them into the image cache if necessary, and remove them from the HTML, at a very small cost. treating your HTML as an object model rather than a text blob has its advantages...)

(not that data URL:s are generally bad; each HTML request required to render a page has a cost too, even if it's only a cache check. and people who just drop by your site to look at a page or two seldom has your stuff in their caches...)

Roberto August 17, 2007 at 5:33 a.m.

Hi, where can I download a PDF/JPG Django CheatSheet?
Thanks

Evan August 25, 2007 at 12:43 p.m.

Roberto: http://www.mercurytide.co.uk/whitepap...

Comments are closed

To prevent spam, comments are no longer allowed after sixty days.