Jean-Luc wrote:
> igor Guerrero a écrit :
>
>> Django dont serve media files, that is the job of the production server
>> but if yo are using the development server: you can try this:
>>
>> http://www.djangoproject.com/documentation/static_files/
Based on above doc, I had same trouble as you Jean Luc but managed to
succeed, here is the key :
All my django projects are in /home/django so I have /home/django/myproject.
If you create a directory site_media within this one you should add in
urls.py :
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': '/home/django/myproject/site_media', 'show_indexes':
True}),
Then, in your template, you'll have :
<link rel="stylesheet" href="/site_media/css/style.css" type="text/css"
media="screen" />
... if your css file is /home/django/myproject/site_media/css/style.css
HTH,
Nicolas
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---