fix url imports and hashlib for django 1.6