generalizing for django