Upgrade for latest Django and Python compatibility