Look, there are two distinct things here:
a) The admin media, which physically resides on
django/contrib/admin/media and which the dev-server serves
automagically and
b) Your own media, which you are responsible of serving, either in
production or development mode
Here's what I do:
For admin media:
ADMIN_MEDIA_PREFIX = '/media/'
this results in the following url in admin (generated):
<link rel="stylesheet" type="text/css" href="/media/css/dashboard.css"
/>
For my own media, I use the following url (hand coded):
href="/static/a/b/c/style.css"
Then, for the development server:
Admin media: Do nothing
My media: add the following line to the main urls.py
urlpatterns += patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': 'D:/orestis/django/static/'}),
)
Where 'D:/orestis/django/static/' is the directory which holds the
media.
For the production server:
Admin media: Create a link named "media" under the root www directory
that points to django/contrib/admin/media
My media: copy the static directory mentioned above to the root www
directory. Comment the above added line in urls.py
So your www directory should have:
media (symlink)
static (directory with your media)
Then you have to instruct your webserver to deal with those two
directories as it would, ie. without any django processing.
...
I hope this clears things up.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---