Geoffrey-Django/util.py

13 lines
209 B
Python

import string
import random
def create_token(length=25):
token = ''
for i in range(0, length):
d = random.choice(string.digits + string.ascii_lowercase)
token += d
return token