utils.py
author Nishanth Amuluru <nishanth@fossee.in>
Fri, 07 Jan 2011 08:56:24 +0530
changeset 252 5a92fcacdd5a
parent 251 1773b48559e1
child 253 beb830b0e744
permissions -rw-r--r--
Created a form for user creation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
251
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     1
import string,random
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     2
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     3
def make_key():
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     4
    """ return a 10 character random key.
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     5
    """
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     6
    
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     7
    return ''.join([ random.choice(string.uppercase+string.digits) for i in range(10)])
1773b48559e1 Added make_key to utils
Nishanth Amuluru <nishanth@fossee.in>
parents: 250
diff changeset
     8