Forums

img src not showing picture

My page: https://bbqbailey.pythonanywhere.com/ is not showing correctly - image is missing.

I see the picture if I do this from a computer that is logged into pythonanywhere.

I do not see it on any other computer!

So I'm expecting that some sort of permissions problem is going on, but the "ls -al" in console shows everything with 644 permission.

The text is displayed correctly, as is the 'alt' info, but the actual image isn't shown.

I put the image at: /home/mysite/learningFlask/SarahJustinEngaged.jpg, and I can see it as stated above, but no other computers can see it. If I use this in the "<img src" location, it doesn't work anywhere, logged in or not.

What am I missing????? Help! We're wanting to show this to family and friends now!!!

Here is my code :::python <!DOCTYPE html> <html> <body> <h1>Sarah and Justin are Engaged!</h1> <img src="https://www.pythonanywhere.com/user/bbqbailey/files/home/bbqbailey/mysite/learningFlask/SarahJustinEngaged.jpg" alt="Sarah and Justin are Engaged!" width="567" height="500"> </body> </html>

It doesn't work if you use the direct download link. Use static files instead.

On your web tab, you can put /static/ for the URL, /home/bbqbailey/mysite for the file path, set the img src to /static/learningFlask/SarahJustinEngaged.jpg, then reload web app

And my website is better than yours

johnobama: Thanks! That did the trick!

I had researched the 'static', but the following statement led me to believe use of 'static' was optional, not required:

"Our static files support is an optional extra. If you're happy letting your web framework serve static files for you, then that's fine. "

user dull: so what? lol

If you want your web framework to serve your static files, you usually need to configure it to do so. The docs for the framework will have the details of how to do that.

Thanks Glen! Yes, found that out, and have corrected.

Note the documentation, which led me astray:

"Our static files support is an optional extra. If you're happy letting your web framework serve static files for you, then that's fine. "

If you use bootstrap, then you can make it as good as my site

Why edit button not woeking

@dull - the edit button works fine. Given your other issues with the forums discussed in the other thread, we'll have to assume it's also something to do with your environment or your usage.

edit the post for me pls

Oh wait it actually does woek

OK, that's good to hear.

w o e k