开发者

Django: retrieve session or cookies in middleware

开发者 https://www.devze.com 2023-01-26 14:54 出处:网络
can i get the current session or cookie inside a middleware? I tried but I got: \'WSGIRequest\' 开发者_运维问答object has no attribute \'session\'

can i get the current session or cookie inside a middleware?

I tried but I got:

'WSGIRequest' 开发者_运维问答object has no attribute 'session'


This will work in any middleware that comes after django.contrib.sessions.middleware.SessionMiddleware in settings.py.

0

精彩评论

暂无评论...
验证码 换一张
取 消