﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
896	[patch] Error serving media files throught django development server on windows	Petar Marić <petar.maric@…>	Adrian Holovaty	"'''Symptoms:''' unable to serve media files on windows, getting a large number of 302 redirects

'''Problem:''' It seems that something is replacing slashes with backslashes in the url as shown in django-admins runserver log:
{{{
[24/Nov/2005 09:15:23] ""GET /media/css/print.css HTTP/1.1"" 302 0
[24/Nov/2005 09:15:23] ""GET /media/css/css%5Cprint.css HTTP/1.1"" 302 0
[24/Nov/2005 09:15:23] ""GET /media/css/css%5Cprint.css HTTP/1.1"" 302 0
[24/Nov/2005 09:15:23] ""GET /media/css/css%5Cprint.css HTTP/1.1"" 302 0
...
}}}

'''Solution:''' replace backslashes in newpath with slashes

'''Patch:'''
{{{
Index: static.py
===================================================================
--- static.py	(revision 1396)
+++ static.py	(working copy)
@@ -34,7 +34,7 @@
         if part in (os.curdir, os.pardir):
             # strip '.' amd '..' in path
             continue
-        newpath = os.path.join(newpath, part)
+        newpath = os.path.join(newpath, part).replace('\\', '/')
     if newpath and path != newpath:
         return HttpResponseRedirect(newpath)
     fullpath = os.path.join(document_root, newpath) 
}}}

'''Credits:''' nesh for helping me create this patch"	defect	closed	Core (Other)	dev	normal	fixed			Unreviewed	1	0	0	0	0	0
