I encountered the problem described in ticket #279, and fixed it by
changing django/core/management.py:

Index: django/core/management.py
===================================================================
--- django/core/management.py   (revision 493)
+++ django/core/management.py   (working copy)
@@ -360,8 +360,10 @@
     # installed.
     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)
+    fp = open(admin_settings_file, 'w')
+    # In case we are on Windows, take care with backslashes.
+    admin_template_dir_escaped = ADMIN_TEMPLATE_DIR.replace('\\',
'\\\\')
+    settings_contents =
re.sub(r'(?s)\b(TEMPLATE_DIRS\s*=\s*\()(.*?)\)', "\\1\n    r'%s',\\2)"
% admin_template_dir_escaped, settings_contents)
     fp.write(settings_contents)
     fp.close()
     # Create a random SECRET_KEY hash, and put it in the main
settings.

(Not sure why the "fp = open.." line is marked as changed)

What is the right way for me to submit a fix?  These lines have been
wrapped!

--Ned.
http://nedbatchelder.com

Reply via email to