TypeError: 'float' object cannot be interpreted as an integer
This commit is contained in:
parent
c892cd5ae1
commit
21e9a4508d
|
@ -11,10 +11,10 @@ debug = os.environ.get("DEBUG") == "True"
|
|||
|
||||
|
||||
def get_random_secret(length):
|
||||
secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(length/4))
|
||||
secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(length/4))
|
||||
secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(length/4))
|
||||
return secret_key + ''.join(random.choice(string.digits) for x in range(length/4))
|
||||
secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4)))
|
||||
secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4)))
|
||||
secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4)))
|
||||
return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4)))
|
||||
|
||||
|
||||
SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8')))
|
||||
|
|
|
@ -10,10 +10,10 @@ _basedir = os.path.abspath(os.path.dirname(__file__))
|
|||
|
||||
# generate random secrets for unittest
|
||||
def get_random_secret(length):
|
||||
secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(length/4))
|
||||
secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(length/4))
|
||||
secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(length/4))
|
||||
return secret_key + ''.join(random.choice(string.digits) for x in range(length/4))
|
||||
secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4)))
|
||||
secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4)))
|
||||
secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4)))
|
||||
return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4)))
|
||||
|
||||
|
||||
THREADS_PER_PAGE = 8
|
||||
|
|
Loading…
Reference in New Issue