#!/usr/bin/env python
# This script will generate a random 50-character string suitable for use as a SECRET_KEY.
import random

charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'
secure_random = random.SystemRandom()
print(''.join(secure_random.sample(charset, 50)))

@@ -113,22 +113,23 @@
 %0Aimport 
-random
+secrets
 %0A%0Acharse
@@ -215,46 +215,8 @@
 +)'%0A
-secure_random = random.SystemRandom()%0A
 prin
@@ -232,35 +232,44 @@
 (sec
-u
 re
-_random.sample(charset, 
+ts.choice(charset) for _ in range(
 50))

Fix how SECRET_KEY is generated