-
包含會話信息的 dictionary-like 對象。有關完整詳細信息,請參閱會話文檔。
要修改會話然後保存它,必須先將其存儲在一個變量中(因為每次訪問此屬性時都會創建一個新的
SessionStore
):def test_something(self): session = self.client.session session['somekey'] = 'test' session.save()
本文介紹 django.test.Client.session
的用法。
聲明
Client.session
相關用法
- Python Django Client.get用法及代碼示例
- Python Django Client.post用法及代碼示例
- Python Django Client.login用法及代碼示例
- Python Django Client用法及代碼示例
- Python Tableau CSVRequestOptions用法及代碼示例
- Python Django ContentTypeManager用法及代碼示例
- Python Calendar itermonthdays2()用法及代碼示例
- Python Condition release()用法及代碼示例
- Python Collections.UserString用法及代碼示例
- Python Calendar monthdatescalendar()用法及代碼示例
- Python Condition notify()用法及代碼示例
- Python CSV轉JSON用法及代碼示例
- Python Django ContextMixin.get_context_data用法及代碼示例
- Python Django CustomUserManager.create_user用法及代碼示例
- Python Condition wait()用法及代碼示例
- Python Django Coalesce用法及代碼示例
- Python Calendar itermonthdates()用法及代碼示例
- Python Calendar iterweekdays()用法及代碼示例
- Python Django CustomUserManager.create_superuser用法及代碼示例
- Python Django Cot用法及代碼示例
- Python Calendar monthdayscalendar()用法及代碼示例
- Python Calendar itermonthdays3()用法及代碼示例
- Python Django Ceil用法及代碼示例
- Python Sympy Curve.translate()用法及代碼示例
- Python Collections.UserDict用法及代碼示例
注:本文由純淨天空篩選整理自djangoproject.com大神的英文原創作品 django.test.Client.session。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。