from functools import wraps
from django.shortcuts import redirect

def login_required(view_func):
    @wraps(view_func)
    def _wrapped_view(request, *args, **kwargs):
        if 'user_email' not in request.session:
            return redirect('login_view')  # Redirect to your login URL name
        return view_func(request, *args, **kwargs)
    return _wrapped_view
