Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# django3-password-generator

* This is a web application made solely using the most popular web development for Python, that is, Django to generate new strong passwords.
* User is given the freedom to choose his password length, if he wants Upper Case characters, Special characters and Numbers.
* Additional functionality increases the password security by preventing the same characters to be added again and again.
10 changes: 8 additions & 2 deletions generator/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ def password(request):
length = int(request.GET.get('length',12))

thepassword = ''
for x in range(length):
thepassword += random.choice(characters)
x = 0
while x < length:
charac = random.choice(characters)
if charac not in thepassword:
thepassword += charac
x += 1
else:
continue

return render(request, 'generator/password.html', {'password':thepassword})