Added autentication logic. All the views need login_required middleware