Posts for Python

Feb 28

Concurrent Python (AWPUG talk resources)

I'm doing a concurrency/gevent talk tonight at the Austin Web Python User Group. Slides and other resources are available here.

Feb 06

Evented Django part one: Socket.IO and gevent

The buzz around the asynchronous, real-time web has been getting more and more attention lately, and for good reason. The old paradigm of thick servers and thin clients is getting outdated as the new web demands rich, fast, asynchronous, full-duplex messaging. The technologies that enable server-to-browser asynchronous messaging have been given the umbrella term "Comet," and the number of ways to provide Comet services is growing constantly. The transport options include XHR-multipart, WebSockets, and Adobe Flash Sockets, among others. Socket.IO was invented to provide a unified interface for server-browser messaging and let the developer not worry about the inconsistent browser support. In this post, I'm going to explain how to use Django with Socket.IO.

Feb 03

Thread-Safe Object-Oriented Views in Django

An emerging design pattern in Django is the usage of class-based views. Writing views as classes is made possible by Python features that allow classes and objects to behave as callables, just like functions. They can help organize view code and promote reusability by offering a greater level of customization. However, callable objects sometimes have thread safety issues that developers are often not aware of.

Oct 31

Building Search into Pip

I've begun using pip frequently for working with python packages in my virtualenvs. pip does a great job with installing (and now uninstalling) python packages, but it currently lacks a command that I miss from other types of package managers, such as aptitude and port -- search.

Sep 09

Introduction to Surlex Slides from Djangocon 2009

I have uploaded my slides from my lightning talk on Surlex at Djangocon 2009.

Sep 06

Introduction to Surlex

Surlex (Simple URL Expression) is a language for matching and extracting text, similar to regex (regular expression). It works by generating a regular expression from a more concise syntax that is designed to produce easy-to-read url patterns.