from django.contrib.auth.decorators import login_required @login_required(login_url='/example url you want redirect/')