Skip to content

Commit 457d2d2

Browse files
committed
Fixed random password generator
1 parent 716af46 commit 457d2d2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

wsgi/openshift/openshiftlibs.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ def make_secure_key(key_info):
6363
key = key_info['variable']
6464
original = key_info['original']
6565

66-
chars = '0123456789'
67-
chars += 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
68-
chars += '!@#%^&*()'
69-
chars += '-_ []{}<>~`+=,.;:/?|'
66+
# These are the legal password characters
67+
# as per the Django source code
68+
# (django/contrib/auth/models.py)
69+
chars = 'abcdefghjkmnpqrstuvwxyz'
70+
chars += 'ABCDEFGHJKLMNPQRSTUVWXYZ'
71+
chars += '23456789'
7072

7173
# Use the hash to seed the RNG
7274
random.seed(int("0x" + hashcode[:8], 0))

0 commit comments

Comments
 (0)