﻿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
17689	CachedFilesMixin causes ValueError when provided with a path to url()	tkaemming	nobody	"For example, trying to set `window.__admin_media_prefix__` in `admin/base.html` causes this error.

Here's the offending template tag:
https://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templates/admin/base.html#L9

Traceback (I cut out the `render` bits and only left the parts significant to the issue at hand):
{{{
[pid: 23479|app: 0|req: 2/11] 127.0.0.1 () {40 vars in 780 bytes} [Tue Feb 14 19:42:53 2012] GET /admin/ => generated 168 bytes in 430 msecs (HTTP/1.0 500) 4 headers in 174 bytes (1 switches on core 0)
Internal Server Error: /admin/
Traceback (most recent call last):
  File ""/srv/versions/development/src/django/django/contrib/staticfiles/templatetags/staticfiles.py"", line 13, in static
    return staticfiles_storage.url(path)
  File ""/srv/versions/development/src/django/django/contrib/staticfiles/storage.py"", line 111, in url
    hashed_name = self.hashed_name(clean_name).replace('\\', '/')
  File ""/srv/versions/development/src/django/django/contrib/staticfiles/storage.py"", line 74, in hashed_name
    (clean_name, self))
ValueError: The file 'admin/' could not be found with <example.utils.storage.CachedS3BotoStorage object at 0x8ce99cc>.
}}}

I've attached a patch that prevents CachedStaticMixin from attempting to hash names ending in a path separator (forward slash only), incl. tests."	Bug	closed	contrib.staticfiles	1.4-alpha-1	Normal	fixed			Unreviewed	1	0	0	0	0	0
