NOJIRA: minor changes to make this work with Django 1.7+