Authentication and permission

Can someone please help or redirect me about how to do when i would like that super admin send in an email a username and a random password to a new registry who register with all needed information else his username and password ?

You do not want to send a password in an email.

Take a look at the password reset process that Django provides to get an idea of how this can be handled.

See Using the Django authentication system | Django documentation | Django, and PasswordResetView

that’ true about the password in an email Thanks a lot,
so how about the username ?

What specifically do you want to have happen? Or to phrase this a different way, what is the sequence of events you’re trying to make happen?

What I’m understanding from what you’ve written:

  • User registers with some information, except for a username and password.
    • You can do this with a regular form and a model to temporarily hold this information.
  • An admin approves the registration information and supplies a user name.
    • This can be another form, where the view creates the User object with the username entered by the admin. That view then deletes the row from the temporary table and causes the password-reset email to be sent.

Yes you are approximately right.
There are what i want:

  • As system admin, approve the registration of the new members and generate their
    username and password.

  • The username should be the last name of the customer and
    two digits to ensure they are unique. Eg. {lastname01…. lastname02…lastname##}.

  • The password should be randomly generated and must be alphanumeric.

Thank you very much.

Your first two bullet items would be handled by the process I identified in the second point from my post.

Your third point is fundamentally a bad idea.

Ok I see, I’m very glad of your response, now I’m going to explore your suggestions.
Thank you so much, you are doing well.