Possible Duplicate:
Django Password Generator
d = Data.objects.get(key=key)
User.objects.create_user(username = d.name, email= d.email, password = password)
How to create random password and send this via e-mail to user (d.email
) ?
A random password generator is software program or hardware device that takes input from a random or pseudo-random number generator and automatically generates a password. Random passwords can be generated manually, using simple sources of randomness such as dice or coins, or they can be generated using a computer.
A random password generator is a software program, hardware device, or online tool that automatically generates a password using parameters that a user sets, including mixed-case letters, numbers, symbols, pronounceability, length, and strength.
in django make_random_password
is a built in method for generating random password
my_password = User.objects.make_random_password()
it accepts parameters as length
and allowd_chars
with that you can limit the password length and special symbols and numbers
def view_name(request):
#make random password
randompass = ''.join([choice('1234567890qwertyuiopasdfghjklzxcvbnm') for i in range(7)])
#sending email
message = "your message here"
subject = "your subject here"
send_mail(subject, message, from_email, ['to_email',])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With