9

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 Anonymous 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!

RadiantHex
  • 24,907
  • 47
  • 148
  • 244
  • What's wrong with using the session framework? Isn't that what it's for? – Daniel Roseman Mar 19 '10 at 22:42
  • @DanielRoseman if you have a (temporary) user, you can save related data, and just take it and go ahead when the user is getting real/official. I guess this is the reason the OP requests this. – benzkji Nov 27 '18 at 23:36

2 Answers2

18

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.

Benjamin Wohlwend
  • 30,958
  • 11
  • 90
  • 100
0

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/