Monkeypatching Django Admin

14 Oct 2011 - webdev mozilla

When I started contributing to Mozilla Webdev, I started with Input. The bug that was always a mystery to me was bug 658658. The login page to Django’s admin worked in Django 1.2.3, but didn’t work with 1.3, which is what was in the input vendor. At that time, I didn’t know about monkeypatching Django well enough, or care enough to fix this. Last night, I was scrolling through bzhome (Thanks again Heather!) to find this bug again.

This is how it looks before I fixed it

Before fixing

After 3 hours of working with folks in #webdev, especially jsocol, peterbe), and r1cky, we finally fixed it. The problem was that the monkey patching didn’t catch one case, the login and logout views which where not in django.contrib.admin but in django.contrib.auth. Thanks to everyone’s patience (especially r1cky, since we spent about 1 hour trying various combinations of things), the bug is fixed and I now know a little more about monkeypatching.

After fixing