updated for django compatability