Python-diango-cookie & session

 

views视图内设置session :

request.session['username']='S1700622'

 

views视图内取session:

print(request.session['username'])

 

html 网页内取session:

 <h3>session: {{request.session.username}}</h3>

 

posted @ 2021-01-29 22:33  leungqingyun  阅读(47)  评论(0编辑  收藏  举报