I’d like to create a subset of Users that don’t have a login… basically as a way to add a photographer field to photos without having a full blown account associated with that person (since in many cases, they’ll never actually log in to the site). A caveat is that I’d also like to be able to enable an account for them later.
So, I think the question becomes what’s the best way to set up a ‘People’ table that ties to the User table without actually extending the User table with UserProfile.
A user profile (as returned by
django.contrib.auth.models.User.get_profile) doesn’t extend the User table – the model you specify as the profile model with theAUTH_PROFILE_MODULEsetting is just a model which has aForeignKeytoUser.get_profileand the setting are really just a convenience API for accessing an instance of a specific model which has aForeignKeyto a specificUserinstance.As such, one option is to create a profile model in which the
ForeignKeytoUsercan benulland associate yourPhotomodel with this profile model instead of theUsermodel. This would allow you to create a profile for a non-existent user and attach a registered User to the profile at a later date.