Change function views to class based views.