Home > flask, python > [flask] show external images with an app. running on localhost

[flask] show external images with an app. running on localhost

Problem
I have a Flask app. that I run on my local machine. I wrote it years ago and it worked well at that time. Now, I tried to run it again but the external images didn’t appear, they were broken. These are images that are located somewhere else, I just link them. When I copied their URL and pasted in the location bar of the browser, they appeared. What da?

Solution
It seems Firefox is blocking localhost, so when I visited http://127.0.0.1:5000, some of its elements got blocked.

As a workaround, I added the following line in my /etc/hosts file:

127.0.0.1   jabba-hq

Then, when I visted http://jabba-hq:5000, the images appeared normally.

Categories: flask, python Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: