Django - Display ImageField
An ImageField
contains a url
attribute, which you can use in your templates to render the proper HTML.
{% block content %}
<img src="{{ carx.photo.url }}">
{% endblock %}
You can also make use of the Static URL in Settings.py. Make a directory for example "Uploads", in the Static directory of your app. Also change this in your model in models.py
.
Use the following code:
<img src="{% static carx.photo.url %}" />