I tried to customize django’s admin css….but I’m stuck ….i did find a lot of similar discussions here…still I’m not clear… here is what I see…
In base.html, we have
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}"
the line resolves to
<link rel="stylesheet" type="text/css" href="/media/css/base.css">
in the installed admin, base.html is originally located in
C:\Python27\Lib\site-packages\django\contrib\admin\templates\admin
to customize the admin app, I copied admin\templates\admin
to my project templates directory. And then I copied all the C:\Python27\Lib\site-packages\django\contrib\admin\media to my project as PROJECT_ROOT\media.
I hope
<link rel="stylesheet" type="text/css" href="/media/css/base.css">
will use PROJECT_ROOT\media\ for css…..
However, django still uses C:\Python27\Lib\site-packages\django\contrib\admin\media ….
could some one explain why?
Further, what I need to do to let href=”/media/css/base.css” use PROJECT_ROOT\media\?
thanks.
Make sure that the URL for your admin media is configured in the settings for ADMIN_MEDIA_PREFIX:
Also, if you’re using django’s development server, see the docs on How to serve static files: