Django

Code

Changeset 5593

Show
Ignore:
Timestamp:
07/03/07 10:09:05 (1 year ago)
Author:
adrian
Message:

Fixed #4688 -- startproject no longer breaks when Django files are read-only. Thanks, tstromberg@google.com and Google guys

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r5558 r5593  
    236236    torne-django@wolfpuppy.org.uk 
    237237    Karen Tracey <graybark@bellsouth.net> 
     238    tstromberg@google.com 
    238239    Makoto Tsuyuki <mtsuyuki@gmail.com> 
    239240    tt@gurgle.no 
  • django/trunk/django/core/management.py

    r5519 r5593  
    833833        sys.exit(1) 
    834834    _start_helper('project', project_name, directory) 
     835 
    835836    # Create a random SECRET_KEY hash, and put it in the main settings. 
    836837    main_settings_file = os.path.join(directory, project_name, 'settings.py') 
    837838    settings_contents = open(main_settings_file, 'r').read() 
     839 
     840    # If settings.py was copied from a read-only source, make it writeable. 
     841    if not os.access(main_settings_file, os.W_OK): 
     842        os.chmod(main_settings_file, 0600) 
     843 
    838844    fp = open(main_settings_file, 'w') 
    839845    secret_key = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])