Gregor Müllegger's Weblog

JPype - Bridging the worlds of Java and Python

22. July 2010 - view comments

Using ipython's debugger as pdb replacement.

22. July 2010 - view comments

Do you know how to debug your python code? I usually do the following in my code to set something like a hardcoded breakpoint:

import pdb; pdb.set_trace();

This will bring up a pdb prompt when the code execution reaches this line. But pdb is a bit limited since it doesn't support code completion, syntax highlighting and so on.

So here is how you make your debug prompt more fancy by using ipython's debugger.

read more.

Websocket support for django!

20. July 2010 - view comments

You know what WebSockets are? It's a new web protocol for bidirectional connections between the browser and your application server. This is a huge win over AJAX and plain HTTP since you don't need to establish a new connection for every tiny message.

Like TCP socket but for the web.

It's an exciting new technology - so I started experimenting with WebSockets and with my favourite webframework Django. Here is what I came up with, bundled into a reusable app called django-websocket.

read more.

Enable setup.py test in your Django apps

17. July 2010 - view comments

Erich Holscher has posted a blog entry with the same title about a year ago. This helped me out quite a lot to get python setup.py test working with a reusable app.

Unfortunatelly the code in his blog post is not working anymore exactly like this. Django has changed its internal structure of its default test runner. So here is how you can get setup.py test working today.

read more.

Django admin with read-only permission

1. July 2010 - view comments

I work as a freelancer and do many django related projects. My clients care in most cases very much about django's admin site and want to have it customized in many different ways.

One client even has a django project that uses the admin site as only frontend. It's an intranet CRM system - but they need to assigned every employee change permissions because every user must be able to view every entry.

Since django doesn't support read permissions in the admin this was the only way to do it. Here is a quick-and-dirty fix without creating extra views for readonly pages, extra templates etc.

read more.

Howto reset your ASUS EEE 1101HA

17. June 2010 - view comments

I recently bought a cute little ASUS EEE 1101HA. The first thing I've done after receiving it was installing the latest Ubuntu version. So I hoped the best. But after trying some things and searching the Internet it seems that the Linux support for this netbook really sucks.

Display isn't working very well, multitouch touchpad doesn't work, microphone doesn't work properly and so on. I expected to have some small issues which I need to solve, but this was too much.

I decided to sell it again - but usually customers aren't that happy if you promise them a WinXP netbook but they receive one with a broken ubuntu ;-)

So I needed to do reinstall windows xp from the recovery DVD. This isn't as easy as it sounds, since the netbook has no optical drive.

read more.

Create patches for upstream with bzr

21. April 2010 - view comments

I searched a long time for a nice way to create clean diffs between two bzr branches. The command bzr diff remote-branch is not working ... Now I found a solution using a special revision identifier.

read more.

Compile csync from source on Ubuntu 9.10

15. March 2010 - view comments

Since csync is not available in the Ubuntu repositories and there are no .deb packages available on csync's website you have to compile it yourself from source. It's nearly straight forward but there were a few issues I ran into. Maybe this short walkthrough help you to make the installation of csync as easy as possible.

read more.

A quote from Volker Dusch

10. March 2010 - view comments

Unittests are like a warm blanket you can wrap yourself into if you need to go out into the codeforest to refactor

by Volker Dusch

Test Driven Development - The Django Way

10. March 2010 - view comments

about

Gregor Müllegger's Weblog on django, python, vim and anything else.

Feel free to contact me if you have question about my life, my work or my projects.

Know me …