#在views.py中加入
from django.contrib.auth import authenticate,login
user = authenticate(username=user_name,password=pass_word)
if user is not None:
login(request,user)
#html判断是否已经登陆
{% if request.user.is_authenticated %}
{%else%}
{% endif %}
表单验证
最新推荐文章于 2023-03-16 10:17:29 发布