print(user_obj.username). 給驗證成功的用戶加session,將request.user 賦值為用戶對象。 登陸使用login() 方法。 使用前要導入: from django.contrib import auth.
確定! 回上一頁