Home > database >  Images not hosted on server with flask, jinja2 and html
Images not hosted on server with flask, jinja2 and html

Time:11-13

I want to load images from links with flask and jinja2. This is what I'm trying:

<img alt="Image" src="{{ anime.cover }}">

I have checked that anime.cover = https://animeflv.net/uploads/animes/covers/2430.jpg, but the images won't load. What is a possible solution?

Thank you in advance!

CodePudding user response:

First check to make sure you're getting your anime object (I can't tell from the question).

Then, check to make sure your anime object has a cover attribute.

  • If it does, open up your browser's Developer Tools and inspect the src attribute of the img element. If you see the cover attribute's text inside the src attribute, you should be fine. Do a hard page reload and/or flush the browser's cache to see if it shows up then.

  • If it doesn't show up, there's an issue between your server and the server sending the information to that route.

  • Related