Ticket #4688: django-core-management.patch
File django-core-management.patch, 850 bytes (added by , 17 years ago) |
---|
-
core/management.py
835 835 # Create a random SECRET_KEY hash, and put it in the main settings. 836 836 main_settings_file = os.path.join(directory, project_name, 'settings.py') 837 837 settings_contents = open(main_settings_file, 'r').read() 838 839 # We may have copied from a read-only source, so lets make settings.py writeable if so. 840 if not os.access(main_settings_file, os.W_OK): 841 os.chmod(main_settings_file, 0600) 842 838 843 fp = open(main_settings_file, 'w') 839 844 secret_key = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)]) 840 845 settings_contents = re.sub(r"(?<=SECRET_KEY = ')'", secret_key + "'", settings_contents)