On Jan 15, 2008 2:21 PM, mOne <[EMAIL PROTECTED]> wrote:

>
> Karen,
>
> 1. In setting.py my media root is set to /Users/sptxk/djcode/mysite/
> bnStyle/media/


Note MEDIA_ROOT has nothing to do with serving static files/css.  It's used
when uploading files to your server.


> 2.  in urls.py (r'^site_media/(?P<path>.*)$',
> 'django.views.static.serve', {'document_root': '/Users/sptxk/djcode/
> mysite/bnStyle/media/'}),


OK, this tells Django that for urls that start with site_media, you want to
use the static server, and additionally tells the static server where to
find the actual files to use in responses.

3. My css files are located  /Users/sptxk/djcode/mysite/bnStyle/media/
> css/


OK, this is the same path as you specified in 2 with 'css' on the end, so
your css files will need to be specified in your templates as starting with
'site_media/css'


> 4. In my template for base.html
> <head>
> <title>{% block title %}{% endblock %}</title>
> <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{%
> load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" /
> >
> {% if LANGUAGE_BIDI %}
>
> <link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}
> {% admin_media_prefix %}css/rtl.css{% endblock %}" />
> {% endif %}
>        {% block extrastyle %}{% endblock %}
>        {% block extrahead %}{% endblock %}
>        {% block blockbots %}
> <meta name="robots" content="NONE,NOARCHIVE" />
> {% endblock %}
> </head>
>
>
But I don't see any references to your own css files here, just admin css
files.  Are you starting with the admin files, customizing them in your own
directory, and that is what you want to load?  Then you need to get rid of
the {% admin_media_prefix %} stuff  -- that is going to resolve to where the
admin media files are.  You need to replace it with something that resolves
to '/site_media', so that the url that winds up in your rendered template
starts with 'site-media', so that the static server is triggered to handle
the request.

Karen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to