Django 1.4 compatibility

Fixes to make massmedia more compatible with Django 1.4