[Fixed]-Always check if user is logged in

1👍

Django has already built login_required decorator for purpose of this

from django.contrib.auth.decorators import login_required

@login_required()
def some_view(request):
    pass

If the user isn’t logged in, redirect to settings.LOGIN_URL

login_required

Leave a comment