My solution is that I have a site-enabled nginx host listening on http://media.site/ which has a document root at say /var/www/site/.
I set my MEDIA_URL = http://media.site/. I import MEDIA_URL into views and send it to the template with say render_to_response(). So, in the stylesheet link for the template I can have href="{{MEDIA_URL}}nameofstylesheet.css" and just put the stylesheet in the document root of the static media server. I usually now make a symbolic link from a media/ subdirectory in my project folder to /var/ www/site. Hope that helps and if anyone knows if there is a cleaner way to accomplish I would be interested. On Jan 12, 3:25 am, "[email protected]" <[email protected]> wrote: > Im trying to get the template to load the CSS, but it does not load, > the server output shows a 404. > > in templates directory i have > > /default/layout.html (this is the website layout) > /articles/index.html (the template defining blocks to replace in the > template) > > I've tried a few things, im not real sure where to put the css and how > to reference the location properly > > layout.html: > > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=ISO-8859-1"> > <link rel=StyleSheet href={% block style %} "stylesheet.css" {% > endblock %} type="text/css"> > <title> {% block title %} {% endblock %} </title> > </head> > > index.html: > > {% block style %} "stylesheet.css" {% endblock %} > > which results in "GET /articles/stylesheet.css HTTP/1.1" 404 > > the stylesheet.css is actually in the same location as index.html. > > preferably i dont want the css file there but in a global location, > can someone tell me whats going on here? > thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

