Re: Image Location
On Sat, Sep 5, 2009 at 7:37 PM, A. Rossiwrote: > > I am suffering a similar problem, but I think the problem is that my > URLConf is improperly configured to display the images. > Could somebody direct me to the proper documentation for displaying > static images with the dev server? > > http://docs.djangoproject.com/en/dev/howto/static-files/ Karen --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Image Location
I am suffering a similar problem, but I think the problem is that my URLConf is improperly configured to display the images. Could somebody direct me to the proper documentation for displaying static images with the dev server? On Aug 23, 9:18 am, "J. Cliff Dyer"wrote: > On Sun, 2009-08-23 at 06:54 -0700, When ideas fail wrote: > > Hello, i'm having a problem getting images todisplayso I was > > wondering if someone would be kind enough to help? > > > I have my settings.py set up as follows (content is the folder where > > my static images are stored): > > > MEDIA_ROOT = '/home/mysite/content/' > > MEDIA_URL = 'http://www.mysites.net/content/' > > > Then my template is like so: > > > > > > where object.post_img = imgs/newMessage.jpg > > > but if i load the page up it doesn't appear. I checked the error log > > it says: > > > File does not exist: /home/mysite/public_html/content, referer: > >http://www.mysite.net > > 1. Check what's getting rendered in your HTML file for the src of that > img. > > 2. Make sure you're using a RequestContext, otherwise you won't have > MEDIA_URL available to your templates. > > 3. Figure out why public_html is showing up in the path reported by the > error log. > > Some information that will help with debugging: > > * Are you using apache, the dev server, or something else? > * If the dev server, where does your URLConf point to for > static images? > * What does the URLConf and view look like for the page that's > getting rendered? > > Cheers, > Cliff --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Image Location
Seems to be working now. Thanks. On 23 Aug, 18:28, When ideas fail <andrewkenyon...@gmail.com> wrote: > I changed it to post_img.url but i assume thats a different way of > doing the same thing. > > 1.The html source gives the image location as "http://www.mysite.net/ > content/imgs/newMessage.jpg" > > 2. I am using a RequestContext. > > Its an apache server and these are the related directives: > > > SetHandler None > > > > allow from all > order allow,deny > SetHandler None > > Alias /imgs/ "/home/mysite/content/imgs/" > > Andrew > > On 23 Aug, 17:18, "J. Cliff Dyer" <j...@sdf.lonestar.org> wrote: > > > On Sun, 2009-08-23 at 06:54 -0700, When ideas fail wrote: > > > Hello, i'm having a problem getting images to display so I was > > > wondering if someone would be kind enough to help? > > > > I have my settings.py set up as follows (content is the folder where > > > my static images are stored): > > > > MEDIA_ROOT = '/home/mysite/content/' > > > MEDIA_URL = 'http://www.mysites.net/content/' > > > > Then my template is like so: > > > > > > > > where object.post_img = imgs/newMessage.jpg > > > > but if i load the page up it doesn't appear. I checked the error log > > > it says: > > > > File does not exist: /home/mysite/public_html/content, referer: > > >http://www.mysite.net > > > 1. Check what's getting rendered in your HTML file for the src of that > > img. > > > 2. Make sure you're using a RequestContext, otherwise you won't have > > MEDIA_URL available to your templates. > > > 3. Figure out why public_html is showing up in the path reported by the > > error log. > > > Some information that will help with debugging: > > > * Are you using apache, the dev server, or something else? > > * If the dev server, where does your URLConf point to for > > static images? > > * What does the URLConf and view look like for the page that's > > getting rendered? > > > Cheers, > > Cliff --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Image Location
I changed it to post_img.url but i assume thats a different way of doing the same thing. 1.The html source gives the image location as "http://www.mysite.net/ content/imgs/newMessage.jpg" 2. I am using a RequestContext. Its an apache server and these are the related directives: SetHandler None allow from all order allow,deny SetHandler None Alias /imgs/ "/home/mysite/content/imgs/" Andrew On 23 Aug, 17:18, "J. Cliff Dyer" <j...@sdf.lonestar.org> wrote: > On Sun, 2009-08-23 at 06:54 -0700, When ideas fail wrote: > > Hello, i'm having a problem getting images to display so I was > > wondering if someone would be kind enough to help? > > > I have my settings.py set up as follows (content is the folder where > > my static images are stored): > > > MEDIA_ROOT = '/home/mysite/content/' > > MEDIA_URL = 'http://www.mysites.net/content/' > > > Then my template is like so: > > > > > > where object.post_img = imgs/newMessage.jpg > > > but if i load the page up it doesn't appear. I checked the error log > > it says: > > > File does not exist: /home/mysite/public_html/content, referer: > >http://www.mysite.net > > 1. Check what's getting rendered in your HTML file for the src of that > img. > > 2. Make sure you're using a RequestContext, otherwise you won't have > MEDIA_URL available to your templates. > > 3. Figure out why public_html is showing up in the path reported by the > error log. > > Some information that will help with debugging: > > * Are you using apache, the dev server, or something else? > * If the dev server, where does your URLConf point to for > static images? > * What does the URLConf and view look like for the page that's > getting rendered? > > Cheers, > Cliff --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Image Location
I changed it to post_img.url but i assume thats a different way of doing the same thing. 1.The html source gives the image location as "http://www.mysite.net/ content/imgs/newMessage.jpg" 2. I am using a RequestContext. Its an apache server and these are the related directives: SetHandler None allow from all order allow,deny SetHandler None Alias /imgs/ "/home/mysite/content/imgs/" Andrew On 23 Aug, 17:18, "J. Cliff Dyer" <j...@sdf.lonestar.org> wrote: > On Sun, 2009-08-23 at 06:54 -0700, When ideas fail wrote: > > Hello, i'm having a problem getting images to display so I was > > wondering if someone would be kind enough to help? > > > I have my settings.py set up as follows (content is the folder where > > my static images are stored): > > > MEDIA_ROOT = '/home/mysite/content/' > > MEDIA_URL = 'http://www.mysites.net/content/' > > > Then my template is like so: > > > > > > where object.post_img = imgs/newMessage.jpg > > > but if i load the page up it doesn't appear. I checked the error log > > it says: > > > File does not exist: /home/mysite/public_html/content, referer: > >http://www.mysite.net > > 1. Check what's getting rendered in your HTML file for the src of that > img. > > 2. Make sure you're using a RequestContext, otherwise you won't have > MEDIA_URL available to your templates. > > 3. Figure out why public_html is showing up in the path reported by the > error log. > > Some information that will help with debugging: > > * Are you using apache, the dev server, or something else? > * If the dev server, where does your URLConf point to for > static images? > * What does the URLConf and view look like for the page that's > getting rendered? > > Cheers, > Cliff --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Image Location
On Sun, 2009-08-23 at 06:54 -0700, When ideas fail wrote: > Hello, i'm having a problem getting images to display so I was > wondering if someone would be kind enough to help? > > I have my settings.py set up as follows (content is the folder where > my static images are stored): > > MEDIA_ROOT = '/home/mysite/content/' > MEDIA_URL = 'http://www.mysites.net/content/' > > Then my template is like so: > > > > where object.post_img = imgs/newMessage.jpg > > but if i load the page up it doesn't appear. I checked the error log > it says: > > File does not exist: /home/mysite/public_html/content, referer: > http://www.mysite.net 1. Check what's getting rendered in your HTML file for the src of that img. 2. Make sure you're using a RequestContext, otherwise you won't have MEDIA_URL available to your templates. 3. Figure out why public_html is showing up in the path reported by the error log. Some information that will help with debugging: * Are you using apache, the dev server, or something else? * If the dev server, where does your URLConf point to for static images? * What does the URLConf and view look like for the page that's getting rendered? Cheers, Cliff --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Image Location
On Sun, Aug 23, 2009 at 3:54 PM, When ideas failwrote: > > Hello, i'm having a problem getting images to display so I was > wondering if someone would be kind enough to help? > > I have my settings.py set up as follows (content is the folder where > my static images are stored): > > MEDIA_ROOT = '/home/mysite/content/' > MEDIA_URL = 'http://www.mysites.net/content/' > > Then my template is like so: > > > > where object.post_img = imgs/newMessage.jpg > > but if i load the page up it doesn't appear. I checked the error log > it says: > > File does not exist: /home/mysite/public_html/content, referer: > http://www.mysite.net > > so it has added public_html to the path, how can i solve this issue? > By using the documented way to output the URL of a FileField / ImageField: Look here for more information: http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield Matthias --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Image Location
Hello, i'm having a problem getting images to display so I was wondering if someone would be kind enough to help? I have my settings.py set up as follows (content is the folder where my static images are stored): MEDIA_ROOT = '/home/mysite/content/' MEDIA_URL = 'http://www.mysites.net/content/' Then my template is like so: where object.post_img = imgs/newMessage.jpg but if i load the page up it doesn't appear. I checked the error log it says: File does not exist: /home/mysite/public_html/content, referer: http://www.mysite.net so it has added public_html to the path, how can i solve this issue? Many Thanks Andrew --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---