Simon Willison’s Weblog

Subscribe
Atom feed for python

1,162 posts tagged “python”

The Python programming language.

2008

Good architectural layering, and Bzr 1.1. Mark Shuttleworth on the growing importance of plug-in architectures as an open source project evolves, as they allow new developers to release their own components without needing commit access to the project. Django is pretty good for this, but more hooks (and a faster event dispatch system) would be useful.

# 9th January 2008, 2:06 pm / hooks, bazaar, bzr, dispatch, django, events, mark-shuttleworth, open-source, programming, python

daemon.py (via) Neat little Python module for daemonizing a process; handles logging and pid files out of the box.

# 8th January 2008, 9:58 pm / python, daemonizing, daemon, pid, logging

Job: Django developer in London. I’m consulting with GCap Media at the moment, who are looking to hire full-time Django developers in London for some really interesting projects. Please feel free to contact me directly with questions.

# 7th January 2008, 9:37 pm / django, jobs, gcapmedia, python

Naming twins in Python and Perl. Simple anagram problem solved in Perl and Python, with a bunch more solutions in the comments. The C# solution provides an interesting example of LINQ in action.

# 7th January 2008, 11:03 am / linq, csharp, python, perl, brad-fitzpatrick, programming, anagrams

FUD and TurboGears. Not cool: the TurboGears guys have been targeted by some (hopefully not deliberate) FUD along the lines of “the author of the TurboGears book is using Django now”, based on Mark posting about his research in to other frameworks.

# 7th January 2008, 9:02 am / mark-ramm, python, turbogears, django, fud

Django Tip: Complex Forms. Malcolm demonstrates some advanced tricks with newforms.

# 6th January 2008, 10:14 pm / newforms, django, python, malcolm-tredinnick

Filtering foreign key choices in newforms-admin. A nice introduction to the Django newform-admin branch, including an example of how to easily implement row-level permissions.

# 6th January 2008, 8:31 pm / django, newforms, newformsadmin, python, christian-joergensen, django-admin

Chatting with Adrian Holovaty. Fabio Akita interviews Adrian about Django and related topics.

# 1st January 2008, 11:44 am / django, adrian-holovaty, python, fabioakita

This Week in Django podcast. Michael Trier’s been doing a really fantastic job putting together a Django podcast. The most recent episode (number 4) includes an update on the newforms-admin branch and a couple of handy tips.

# 1st January 2008, 10:44 am / django, michael-trier, thisweekindjango, python, podcasts, django-admin

2007

django-mptt (via) Jonathan Buchanan’s simple utility for performing Modified Preorder Tree Traversal (efficient tree operations in SQL) on Django models.

# 29th December 2007, 11:33 am / modifiedpreordertreetraversal, mptt, django, python, djangoorm, models, jonathan-buchanan, sql

I definitely like Python 3K's Unicode support better [...] In fact, I think I prefer Ruby 1.8's non-support for Unicode over Ruby 1.9's "support". The problem is one that is all to familiar to Python programmers. You can have a fully unit tested library and have somebody pass you a bad string, and you will fall over.

Sam Ruby

# 28th December 2007, 7:05 pm / ruby, sam-ruby, unicode, python, unittesting, ruby19, rubi18

Django and Comet. How to build a chat application using Django and the Orbited comet server. Orbited can be set up to proxy most requests through to a Django backend while handling any comet requests itself.

# 26th December 2007, 9:05 pm / comet, django, orbited, javascript, python

IPy. Handy Python module for manipulating IP addresses—use IP(ip_addr).iptype() == ’PUBLIC’ to check that an address isn’t in a private address range.

# 24th December 2007, 1:19 pm / ipy, ipaddresses, ip, networking, python, security

Size Is The Enemy. Jeff Atwood: “I’ve started a cottage industry mining Steve [Yegge]’s insanely great but I-hope-you-have-
an-hour-to-kill writing and condensing it into its shorter form points.” Lots of verbose static typing apologists in the comments.

# 24th December 2007, 10:50 am / dynamiclanguages, statictyping, python, jeff-atwood, steve-yegge, java

WebOb. WebOb is “an extraction and refinement of pieces from Paste”—provides a very nice request and response object, clearly inspired partly by Django. The documentation includes the differences between the WebOb API and that of other frameworks.

# 23rd December 2007, 10:22 am / python, webob, paste, ian-bicking, django, frameworks

Pvote (via) Electronic voting machine software in 460 lines of highly readable Python (using Pygame), implemented by Ka-Ping Yee for his doctoral dissertation. Demonstrates prerendering, where as much of the UI as possible is defined in a separate ballot definition file.

# 22nd December 2007, 1:04 pm / electronicvoting, evoting, ka-ping-yee, python, pygame, pvote

Using Unipath to Keep Things Portable. Django tip to avoid hard-coding full paths. I usually set a global called OUR_ROOT in settings.py using os.path.dirname(__file__) and use os.path.join with it to construct any other paths that I need.

# 21st December 2007, 10:45 am / django, python, unipath, michael-trier, settings

Misapplying book terms, Pylons, and the ’end-user’. Ben Bangert responds to Adam Gomaa’s claim that Pylons lacks “conceptual integrity”.

# 19th December 2007, 11:09 am / adam-gomaa, ben-bangert, pylons, python

Frameworks Exist for Conceptual Integrity. Adam Gomaa just taught me a bunch of interesting things about Django’s underlying philosophy. Looks like I need to re-read the Mythical Man-Month.

# 17th December 2007, 1:58 pm / mythicalmanmonth, django, adam-gomaa, python, frameworks, conceptualintegrity

The future of web standards. Nice analysis from James Bennett, who suggests that successful open source projects (Linux, Python, Perl etc) could be used as the model for a more effective standards process, and points out that Ian Hickson is something of a BDFL for the WHAT-WG.

# 17th December 2007, 1:16 pm / w3c, bdfl, whatwg, ian-hickson, james-bennett, web-standards, linux, python, perl, open-source, standards

Chapter 7: Form Processing. The chapter on newforms I contributed to “The Definitive Guide to Django” is now online, along with the rest of the published book.

# 16th December 2007, 9:44 pm / newforms, django, django-book, writing, python

stompserver. I think this is the lightweight message queue I’ve been looking for: written in Ruby and EventMachine, easy to set up (thanks to gems), interoperates perfectly with stomp.py.

# 14th December 2007, 4:40 pm / python, ruby, stomp, messaging, message-queues, eventmachine, lightweight, gems

Two-Faced Django. Excellent Django tutorial by Will Larson that shows how to build a polling application with an interface both on the Web and in Facebook. Also touches on unit testing and Ajax using jQuery.

# 14th December 2007, 2:44 pm / ajax, jquery, javascript, django, python, tutorial, facebook, pyfacebook

Updates to template_utils. James Bennett’s Django template_utils library now provides tags for consuming external RSS and Atom feeds. Combine with template fragment caching for an instant mashup written just using templates.

# 10th December 2007, 3:25 pm / james-bennett, django, templateutils, rss, atom, feeds, universalfeedparser, python

Django snippets: Authenticate against Active Directory. Uses a custom authentication backend with the Python ldap module. If Django hasn’t seen the user before a new Django user account is created with data from ldap.

# 10th December 2007, 8:40 am / ldap, activedirectory, django, authentication, python

Django Basic Apps. Nathan Borror has released a suite of simple, reusable Django applications: Basic Blog, Basic Places, Basic People, Basic Library and Basic Profiles.

# 5th December 2007, 3:30 pm / nathan-borror, django, python

xkcd: Python. Just type “import antigravity”.

# 5th December 2007, 6:09 am / xkcd, python, funny, antigravity, flying

Datejs—A JavaScript Date Library. Building a date API around chaining—Date.today().next().thursday()—is a neat concept. I’d like to see that adapted for Python’s datetime library.

# 3rd December 2007, 9:01 pm / python, datetime, javascript, chaining, datejs

If you only remember one thing about handling non-HTML output via Django: know that you can use the HttpResponse object as if it were a file. Writing to such an object and returning it will give you the output you wrote. It's a very simple concept, but one that translates well to third-party libraries.

Alex de Landgraaf

# 3rd December 2007, 8:44 pm / python, django, views, httpresponse, alex-de-landgraaf