Hi all,
I have tried a few options for auto-creating various fields, but none have worked. At the moment, I would like to focus on an auto-generated username and password (for an external site). The domain would be nice, but I can probably figure that out if I can get the other two working.
For the username, I would like the result to be something like:
username = first_name + last_name + str(integer)
The username seems simple enough, but I am having a hard time figuring where to put that code. Would it go in models.py? Do you write it as a separate variable under the other code? I feel like I may have missed this part in the instructions.
For the password I would like a random selection of letters and numbers (length=10). I have tried the following in models.py:
password = get_random_string(length=10)
and
password = BaseUserManager().make_random_password(length=10, allowed_chars='abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789')
Neither worked, despite importing get_randon_string and BaseUserManager.
Any ideas? Currently my coworker is manually creating all three fields and pasting them into an Excel spreadsheet. I’d love to give him this app with this functionality sorted.
Thank you!