﻿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
23506	How to reference static files outside of the template	thenewguy	nobody	"There should be a function like `django.contrib.staticfiles.templatetags.staticfiles.static` that is safe to use outside of a template.  When it cannot find a static file, it should probably be configured to return a url pointing at a view that logs the file is missing and returns a 404.

I just discovered that I took down an environment with one call to `static` from `django.contrib.staticfiles.templatetags.staticfiles`.

{{{

from django.contrib.staticfiles.templatetags.staticfiles import static

class FooForm(ModelForm):
    class Media:
        js = (
            static(""foo.js""),
        )

}}}

`foo.js` didn't get put in place.

So what is the correct way to reference a static file outside of a template keeping something like `django.contrib.staticfiles.storage.ManifestStaticFilesStorage` in mind?"	Uncategorized	closed	contrib.staticfiles	1.7	Normal	wontfix			Unreviewed	0	0	0	0	0	0
