So basically I want non logged in users to be sent to the login page when they attempt to access pages like the create post or profile page. I know how this is done with function based views, but I am curious how I could do this in CBV's.
class CreatePostView(LoginRequiredMixin,CreateView):
# ... view here
I was wondering how I would redirect users if not logged in
Would I need another function to do this, or is there something in Django that allows this to happen? Thanks :)