First of all, you should set MEDIA_URL to '/media/' and Alias /media  
as /var/www/django_projects/proj_name/media/ or use mod_rewrite. Then  
you should instead request for {{ MEDIA_URL }}test.js not the  
hardcoded /media/test.js. This requires that you have request context  
processor activated and MEDIA_URL is available in the template context.

Erik

On 13.10.2008, at 12:34, huw_at1 wrote:

>
> Hi there. I have a website running out of django on my apache/
> mod_python web server. When trying to link javascript to my templates
> such as:
>
> <script src="/media/test.js">
>
> I keep getting a 404 error stating that "/media/test.js was not found
> on this server".
>
> I have the test.js file located at "/var/www/django_projects/ 
> proj_name/
> media/test.js". So I have set MEDIA_ROOT to be '/var/www/
> django_projects/proj_name/media/' and my MEDIA_URL to be '/'. Also I
> have set <Location "/media"> in my apache conf file to be "SetHandler
> None" to prevent django proceesing media URLs. I can't think what else
> I am missing but for some reason my media files such as "test.js" are
> not being found. I'd appreciate it if anyone could offer any advice on
> this.
>
> Many thanks.
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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