rewrite to use Django generic views