#NEWLINE# def ensure_secret_key_file( ) : #NEWLINE# #INDENT# 'Checks that secret.py exists in settings dir. If not, creates one\n    with a random generated SECRET_KEY setting.' #NEWLINE# secret_path = os . path . join ( ABS_PATH ( 'settings' ) , 'secret.py' ) #NEWLINE# if ( not os . path . exists ( secret_path ) ) : #NEWLINE# #INDENT# from django.utils.crypto import get_random_string #NEWLINE# secret_key = get_random_string ( 50 , 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)' ) #NEWLINE# with open ( f , 'w' ) as f : #NEWLINE# #INDENT# f . write ( ( ( 'SECRET_KEY = ' + repr ( secret_key ) ) + '\n' ) )