expephalon-demomodule/smsotp/helpers.py
Kumi d74a4c1b8b User profile models
SMS OTP provider
Login template (without css)
2020-04-13 20:03:01 +02:00

6 lines
211 B
Python

from dbsettings.functions import getValue
import random
def generate_token(len=getValue("smsotp.length", 6), chars=getValue("smsotp.chars", "0123456789")):
return "".join(random.choices(chars, k=int(len)))