Re: displaying images
On Wed, 2011-11-23 at 08:31 -0800, marjenni wrote:
> Hi all,
> Again, I am sure this is a very common problem for beginners, but
> all help appreciated.
>
>
> In a python function I am building a webpage, and trying to add
> images to a table like this:
>
> html += "<tr> <td><img src=\"/home/www/mysite/images/%s.jpg\" /></td>
> </tr>" % imageName
>
> return HttpResponse(html)
>
>
> Now the table is displayed fine, but images are missing.
>
> The images are present in the directory /home/www/mysite/images/
>
> and in settings.py
>
> MEDIA_URL = '/home/www/mysite/cache/'
>
> any suggestions?
>
> many thanks
>
> Mark
Whenever something isn't displaying (image) or available (JavaScript
function), I always look at the source of the web page to make sure my
paths are what they are suppose to be and that the content I want is at
that path.
Take a look at the source of your rendered page, make sure the image URL
is correct and that there is actually an image there (open the URL in
it's own browser window/tab). Hopefully that will lead you to the
source of your problem.
--
Adam Stein @ HCL America Inc. Email: adam@ppdev.mc.xerox.com
Disclaimer: Any/All views expressed
here have been proven to be my own. [http://www.csh.rit.edu/~adam/]
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home