from django.shortcuts import render
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required

@login_required
def my_profile(request):
    if not request.user.is_authenticated:
        # 用户未登录，重定向到登录页面
        return render('login.html')
    else:
        # 用户已登录
        return render(request, 'profile.html')
