I am running Django on a local Vagrant arch machine on a Win7 host. I set up my environment variables from Django in a .env file. In my app all static files are served correctly and everything works as it should.
Problem: I am not able to serve my static files (images) in my html-email templates. Until now i served them as hardcoded filer URL's and i want to change that.
I am passing BASE_URL BASE_URL=http://127.0.0.1:8001
, which is proved working, as context to the template and loading static as usual:
{% load static %}
and calling it in HTML tag:
<img src="{{BASE_URL}}{% static 'img/my_image.png' %}">
In the received email the URL of the image is http://127.0.0.1:8001/static/img/my_image.png which looks right but triggers a 404.
What am i missing??
(Please dont ask me if the image is in the corresponding folder, it is ;)
127.0.0.1
from your/etc/hosts
file – Vershen