On Wednesday, 17 August 2011 19:00:13 UTC+1, Adam Zedan wrote: > > Hi it seems I cant access data from local static paths such as > c:\\somefolder\somefile.gif in my templates when I enter the url > the code for my template is simplified to something like this > > <!DOCTYPE HTML> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1"> > <title>Demo</title> > </head> > <body> > <img src="file:///c:/bender.gif" /> > </body> > </html> > > The title change to Demo. which shows that the page has loaded but > I get the error in firefox saying: > Security Error: Content at http://127.0.0.1:8000/db/ may not load or link > to file:///c://bender.gif >
No, you can't do that. Why would you want to? Your users aren't going to have that file on their machines, so what's the point of referencing a local file path? You serve the content through your webserver, with an http:// protocol. In development, you can do this through Django's development server: https://docs.djangoproject.com/en/1.3/howto/static-files/ -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/HtvmZxg0QJ4J. 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.

