On Wednesday, April 19, 2017 at 11:45:47 AM UTC-4, P-A juglaret wrote:
>
> Hello everybody as it mention in the title in find difficulties to display 
> my image on my view. 
>
> ( My image is not in a data base like lot of topics but in my folder 
> static/images )
>
> this is the line of code in my index.html: 
>
>  <a src=
> "{{=URL('static','images/pic.png',vars=dict(static=URL('static','images')))}}"
> ></a>   
>
>
First, you need an <img> tag to display an image, not an <a> tag. Second, 
the URL should not use "vars" -- that will produce:

/test/static/images/pic.png?static=%2Ftest%2Fstatic%2Fimages


I suggest you open the browser developer tools to the network tab when the 
page loads and (a) confirm that the browser makes a request to the URL you 
expect for the image, and (b) inspect the response from the server.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to