Django: how correctly set static files (css, js, etc.)?


I have installed django app on dreamhost with passenger.
I have the folders media and static in public folder.
The file is like below:

[quote]STATIC_ROOT = '/home/user/domain/public/static/'
STATIC_URL = ‘http://www.domain/static/’[/quote]

but in template {{STATIC_URL}} is substituted with null string ‘’".

So if i have in my page the path {{STATIC_URL}}js/file.js
the result is only ‘/js/file.js’ and not “http://domain/static/js/file.js

In STATICFILES_FINDERS are specified and STATICFILES_DIRS also is specified.
Some help?


isn’t that what you would want? i thought relative URLs are preferred?


I want that {{STATIC_URL}} is replaced by http://www.domain/ as specified in

I use STATIC_URL variable on localhost, so i would use this on dreamhost too.

It seems that server doesn’t recognize STATIC_URL as variable to be used in template.