1,085 items tagged “python”
The Python programming language.
2008
Django at PyCon. Unfortunately I’ll be missing US PyCon this year (I’ll be at SxSW and Webstock in New Zealand though)—but it’s great to see that there’s a strong line-up of Django related presentations.
django-evserver. Marek Majkowski got Comet working with Django using a custom WSGI server that wraps libevent using ctypes.
Django Developer Jobs. Just an observation: the Django job market is booming at the moment, with 16 new job ads posted so far this year (that’s nearly one a day). If you want to be paid money to develop in Django there’s never been a better time.
Django snippets: “for” template tag with support for “else” if array is empty. A neat solution to a common pattern; I’d personally like to see this included in Django proper.
A little something I’ve been working on. Paul Bissex has been working on a Django book with Jeff Forcier and Wesley Chun, to be published by Prentice Hall. It sounds like they’re a good way along the process.
pysolr. Python wrapper for Solr, the search web service wrapper for Lucene. One thing I’m not clear on: do you need to configure Solr with the fields you’ll be indexing in advance, or can Solr create new fields on the fly to match the data you send it?
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.
daemon.py (via) Neat little Python module for daemonizing a process; handles logging and pid files out of the box.
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.
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.
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.
Django Tip: Complex Forms. Malcolm demonstrates some advanced tricks with newforms.
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.
Chatting with Adrian Holovaty. Fabio Akita interviews Adrian about Django and related topics.
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.
2007
django-mptt (via) Jonathan Buchanan’s simple utility for performing Modified Preorder Tree Traversal (efficient tree operations in SQL) on Django models.
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
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.
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.
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.
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.
Speeding up dateutil: Python’s heapq module turns minutes into seconds. Neat case study in data structure optimisation.
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.
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.
Misapplying book terms, Pylons, and the ’end-user’. Ben Bangert responds to Adam Gomaa’s claim that Pylons lacks “conceptual integrity”.
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.
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.
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.
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.
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.