You can use settings.LOGIN_URL and settings.LOGIN_REDIRECT_URL and view so:
class LoginView(LoginView):
template_name = 'login.html'
login_url='login'
def get_success_url(self):
user=self.request.user.username
return reverse('home', args=(user))
In settings.py:
LOGIN_URL='some_app_name:login' #Redirect to login page if not logged in.
LOGIN_REDIRECT_URL='some_app_name:home' #Redirect to home page after successful login
It defaults to LOGIN_URL and LOGIN_REDIRECT_URL of settings.py if not specified in views.
Note:It's not a good practice to name same your view with actual authentication view so it should beMyLoginViewor anything you can give instead of actual view name.