django login with password code example
Example 1: django request user
def my_view(request):
if not request.user.is_authenticated:
return render(request, 'myapp/login_error.html')
Example 2: loginrequiredmixin
from django.contrib.auth.mixins import LoginRequiredMixin
LOGIN_URL = 'your_url'