Fixed #93 and #279 -- 'django-admin startproject' no longer creates invalid settings/admin.py on Windows
git-svn-id: http://code.djangoproject.com/svn/django/trunk@498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bc00059b2f
commit
1e479ba90d
|
@ -361,7 +361,7 @@ def startproject(project_name, directory):
|
||||||
admin_settings_file = os.path.join(directory, project_name, 'settings/admin.py')
|
admin_settings_file = os.path.join(directory, project_name, 'settings/admin.py')
|
||||||
settings_contents = open(admin_settings_file, 'r').read()
|
settings_contents = open(admin_settings_file, 'r').read()
|
||||||
fp = open(admin_settings_file, 'w')
|
fp = open(admin_settings_file, 'w')
|
||||||
settings_contents = re.sub(r'(?s)\b(TEMPLATE_DIRS\s*=\s*\()(.*?)\)', "\\1\n '%s',\\2)" % ADMIN_TEMPLATE_DIR, settings_contents)
|
settings_contents = re.sub(r'(?s)\b(TEMPLATE_DIRS\s*=\s*\()(.*?)\)', "\\1\n r%r,\\2)" % ADMIN_TEMPLATE_DIR, settings_contents)
|
||||||
fp.write(settings_contents)
|
fp.write(settings_contents)
|
||||||
fp.close()
|
fp.close()
|
||||||
# Create a random SECRET_KEY hash, and put it in the main settings.
|
# Create a random SECRET_KEY hash, and put it in the main settings.
|
||||||
|
|
Loading…
Reference in New Issue