I use a lot of doctests for apps that all need to work on a set of initialized data. I was hoping that there would be some kind of hook in Django for this but there is not. I could switch all of the doctests to unittests and use fixtures but that would be a [...]
Archive for the ‘python’ Category
10 Aug
Log Observer using Python’s subprocess
Today I needed to write a wrapper around a program that would examine the stdio and respond immediately to certain results. The task was handled nicely with a python script using subprocess. There isn’t a lot of documentation examples on it so to figure it out I wrote this small test app and I thought [...]
3 Aug
Starting Out With Comet (Orbited) Part 3 – The Client
Comet implementations require both server and client side components. In Part 2 of this series we installed and configured the server side component and then used the example STOMP Test client to test it out and get a feel for what was going on. In this part of the series we’ll be covering the client [...]
21 Jul
Appengine Example: Quick Thoughts
I’ve made a few apps on Google’s Appengine now and am getting to the point where I can pump them out fairly quickly. I really love that they make user authentication (my least favorite part of web applications) incredibly simplified. I wrote this app in less than an hour as a simple tool for myself [...]
25 Jun
Starting Out With Comet (Orbited) Part 2 – Installation and STOMP
In this part of the tutorial we will install and setup the server side of a Comet installation using the Orbited implementation. We’ll also be using the MorbitQ STOMP server to handle message passing and we’ll play around with STOMP/Comet setup using Orbited’s STOMP Test demo. If you have not read the first blog post [...]
21 May
Deploying MoinMoin on Ubuntu using Apache mod_wsgi
I just went through a somewhat lengthy setup process to deploy a moinmoin wiki on Ubuntu. There’s a lot of documentation on it which actually makes it take a bit longer than I’m used to for getting something running on Ubuntu. I thought I’d share my streamlined notes for this common deployment scenario. The first [...]
11 May
Using Arguments in a Shell Script
Within 5 seconds of looking at a shell script I’m usually opening a new file in my text editor to re-write the ugliness into something that makes more visual sense. To me at least python is highly preferable. Still I use shell scripts all the time to batch a group of commonly used sequential executions, [...]
10 May
‘drop’ Database Command for Django Manager
The Django manager is a really handy tool. I wrote earlier about making your own custom managers and there is a lot of other great documentation on it. Django comes with a bunch of helpful management commands like ‘flush’, ‘syncdb’, ‘test’, etc. I’ve created a generic ‘drop’ command as I felt it was missing. I [...]
6 May
Some Notes and Requests on Django Signals
I’ve finally gotten around to playing with the Django Signals. I’ve been pleased so far but I feel its currently missing a few key features. Some background: Django Signals allows developers to more easily break up their code into separate components which allows much greater freedom and organization. Often as a web application expands you [...]
3 May
Simple MySQLdb Example
MySQLdb is a python interface to MySQL. I wrote the following simple script for some database tests and thought it might be handy to others looking for tutorials or examples. It simply connects to MySQL, drops and creates a database called ‘testdb’, makes a table called ‘waves’ with columns ‘sin’, ‘cos’, ‘tan’, and ‘date’ and [...]