title: Django storing anonymous user data
body: <p>I have a django model which stores user and product data from a form input:</p>
  
  <pre><code>def ProductSelection(request, template_name='product_selection.html'):
      ...
      if user.is_authenticated():
          user = request.user
      else:
          # deal with anonymous user info
      project = Project.objects.create(
          user=user,
          product=form.cleaned_data["product"],
          quantity=form.cleaned_data["product_quantity"],
      )
  </code></pre>
  
  <p>Of course this is fine for authenticated users, but I also want to be able to store anonymous user projects, and if possible, associate them with the user when they eventually register and authenticate.</p>
  
  <p>My idea is to create anonymous user with name = some_variable (timestamp concatenated with a random hash?), then save that username in session data. If I ensure that that session variable, if exists, is used to record all projects activity of that user, I should be able to update the projects with the user's real credentials when they register.</p>
  
  <p>Is this overly complicated and brittle? Do I risk saving thousands of rows of data unnecessarily? What would be the optimal approach for this common issue?   </p>
  
  <p>Any guidance on this would be much appreciated.</p>