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:
Adrian Holovaty 2005-08-15 01:24:16 +00:00
parent bc00059b2f
commit 1e479ba90d
1 changed files with 1 additions and 1 deletions

View File

@ -361,7 +361,7 @@ def startproject(project_name, directory):
admin_settings_file = os.path.join(directory, project_name, 'settings/admin.py')
settings_contents = open(admin_settings_file, 'r').read()
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.close()
# Create a random SECRET_KEY hash, and put it in the main settings.