LoginRequiredMixin
from django.contrib.auth.mixins import LoginRequiredMixin
LOGIN_URL = 'your_url'
Virgin Programmer
from django.contrib.auth.mixins import LoginRequiredMixin
LOGIN_URL = 'your_url'
urlpatterns = [
path('accounts/', include('django.contrib.auth.urls')),
]