I created a website in flask that runs flawlessly on my localhost (localhost:5000). I then created an Amazon Linux 2 AMI ec2 instance and connected to the instance from my browser. Everything is working except the images which are erroring out (404). See below:
Below is my code in flask. It is the same on my local host (works) and in the ec2 instance (doesnt work).
<img src="{{ url_for('static', filename='profile_pics/Logo.jpg') }}" class="img-fluid" alt="Responsive image">
These are the paths on my localhost to the image file and the html file, respectively:
C:\Users\Justin\11.29 - Pound_Tracker\poundtracker\static\profile_pics\Logo.png
C:\Users\Justin\11.29 - Pound_Tracker\poundtracker\templates\layout.html
In my ec2 instance, the paths are:
/var/www/html/poundtracker/static/profile_pics/Logo.png
/var/www/html/poundtracker/templates/layout.html
Please help me find a solution for this!
Thanks in advance!