From 67873552b0687d90884d278c8b1663a465c04d4b Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Mon, 13 Feb 2017 21:57:59 -0800 Subject: [PATCH] Removed single and double quotes from punctuation used in random key --- hooks/post_gen_project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 8b8d4763..fbc6cb69 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -35,11 +35,12 @@ def get_random_string(length=50): The default length of 12 with the a-z, A-Z, 0-9 character set returns a 71-bit value. log_2((26+26+10)^12) =~ 71 bits """ + punctuation = string.punctuation.replace('"', '').replace("'", '') if using_sysrandom: return ''.join(random.choice( - string.digits + string.ascii_letters + string.punctuation + string.digits + string.ascii_letters + punctuation ) for i in range(length)) - + print( "Cookiecutter Django couldn't find a secure pseudo-random number generator on your system." " Please change change your SECRET_KEY variables in conf/settings/local.py and env.example"