Everything works like a charm, except that images listed in my CSS files aren't copied correctly. In my DJANGO_STATIC_SAVE_PREFIX directory, all the images are showing up as 1KB files, but they're corrupt. I tracked this down to line 509 of django_static.py - I don't think binary files can be copied in Python as you have currently. Below is a diff that fixed things for my machine.
diff
--- a/django_static.py Fri May 07 11:23:34 2010 -0600
+++ b/django_static.py Fri May 07 11:25:09 2010 -0600
@@ -3,6 +3,7 @@
import re
import sys
import stat
+import shutil
from glob import glob
from collections import defaultdict
from cStringIO import StringIO
@@ -506,7 +507,7 @@
else:
# straight copy
#print "** STORING COPY:", new_filepath
- open(new_filepath, 'w').write(open(filepath).read())
+ shutil.filecopy(filepath, new_filepath)
return wrap_up(DJANGO_STATIC_NAME_PREFIX + new_filename)
Oh, and this probably only matters on Windows as I'm guessing these would be symlinked in Linux. I'm not sure if this diff is formatted correctly, as this is my first time. Let me know if I can help any futher.
Everything works like a charm, except that images listed in my CSS files aren't copied correctly. In my DJANGO_STATIC_SAVE_PREFIX directory, all the images are showing up as 1KB files, but they're corrupt. I tracked this down to line 509 of django_static.py - I don't think binary files can be copied in Python as you have currently. Below is a diff that fixed things for my machine.
diff
Oh, and this probably only matters on Windows as I'm guessing these would be symlinked in Linux. I'm not sure if this diff is formatted correctly, as this is my first time. Let me know if I can help any futher.