Use the 'login_required' decorator.