Hey,
The admin media setting is only for django's admin interface. For
me, I needed to change some things in the admin interface, and so
copied the media folder (in windows, found in "C:\Python25\Lib\site-
packages\django\contrib\admin\") to the root of my server directory
(alternatively, non-windows systems can use symlinks.) My settings.py
has the default: ADMIN_MEDIA_PREFIX = '/media/'
If you are doing doing something outside the admin interface, that's
a bit different. I have a folder at /projectfolder/media with sub-
folders for css, images, etc., some of which have more sub-folders for
different applications.
Settings.py has: MEDIA_ROOT = 'pathtoproject/media/'
MEDIA_URL = 'http://yoururl.com/media/'
In my templates, to attach a css file I have something like:
{% block attach %}<link href="/projectfolder/media/css/
filename.css" rel="stylesheet" type="text/css" />{% endblock %}
I needed to add some stuff to my apache configuration to serve the
static files, and http://www.djangobook.com/en/beta/chapter21/ and
http://www.djangoproject.com/documentation/static_files/ were helpful
in how to do this. The django dev server doesn't handle the static
files, but that's not a problem for me so I've not looked into if it
can or should.
This works for me, hope it helps.
Michael
On Oct 25, 9:38 am, Greg_IAP <[EMAIL PROTECTED]> wrote:
> Hello,
> I tried to create my own css and to link my applications to this one
> by creating a directory called media in my project.
> i indicated to settings.py of my project to see this directory by
> editing ADMIN_MEDIA_PREFIX = '/media/'
> In this directory i created css img and js directory as the tree of
> the django source code and i copied files from this tree to my own css
> directory(i mean for example dashboard.css renamed dashboard1.css to
> test if it works...)
> I also modified my index.html from my own template like this {% block
> stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/
> dashboard1.css{% endblock %}.....and nothing happens , i mean, my
> dashboard1.css is not read
> could anyone has an experience of this kind of thing? and is it
> working for somebody else?
> If this is the case could anyone show me how to do it?
>
> Thank in advance!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---