开发者

Creating temporary user accounts - Django

开发者 https://www.devze.com 2022-12-24 01:46 出处:网络
I need to setup temporary User models for each visitors, where the visitors are obviously tied by session data.

I need to setup temporary User models for each visitors, where the visitors are obviously tied by session data.

I might not be aware of it, but does Django support attaching data to A开发者_JAVA百科nonymous users?


The only way, I am currently aware of, is to use the session dictionary part of the request object.


Help would be very much appreciated!


Have a look at django-lazysignup

django-lazysignup is a package designed to allow users to interact with a site as if they were authenticated users, but without signing up. At any time, they can convert their temporary user account to a real user account.


I suggest you look for sessions. They use cookies, store a unique id into a cookie which is linked to a file on your server containing their data.

https://docs.djangoproject.com/en/dev/topics/http/sessions/

0

精彩评论

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