S
Size: a a a
S
S
S
S
pydb
VZ
S
An anonymous user doesn't have a primary key or any persistence. You can't identify it by session key or any other identifier. If you want to store the session id, you'll have to add an extra field to your model, then make sure that the user field is populated when the user is registered. Another approach could be to create a user automatically, but don't set it active until the user registers. That has its own problems (e.g. what do you set the email address and username of the inactive user to?)
S
user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True)
S
VZ
S
VZ
<
S
S
<
VZ
S
<
S
S