Django 1.5 compatiblity fixes

This also fixes #2 but break compatibility with django < 1.3 because the new url syntax was not available back then.