0👍
I found the issue. In settings.py
, it should be mimetypes.add_type('image/svg+xml', '.svg', True)
. image
should be singular.
0👍
I faced a similar issue.I would recommend you to use :
src=”{{ STATIC_URL }} images/right-arrow.svg” instead of src=”{% static ‘images/right-arrow.svg’ %}”
svg format might not always identify django’s method of obtaining staticfile contents.Hope this helps 🙂
- [Django]-Django: Sum by date and then create extra field showing rolling average
- [Django]-Django(Python) AttributeError: 'NoneType' object has no attribute 'split'
- [Django]-Django cache_page – prepopulate/pre-cache
0👍
Add this in your settings.py file.
import mimetypes
mimetypes.add_type("image/svg+xml", ".svg", True)
mimetypes.add_type("image/svg+xml", ".svgz", True)
In your cases you have added images in add_type which should be singular (image).
- [Django]-Custom metrics from celery workers into prometheus
- [Django]-Django aggregation over annotated query
- [Django]-Django Channels stops working with self.receive_lock.locked error
- [Django]-I can't insert a footnote into the copied text
0👍
You are loading staticfiles and using static?
This is wrong.
Try changing {% load staticfiles %} <img src="{% static 'images/right-arrow.svg' %}" />
to
{% load static %} <img src="{% static 'images/right-arrow.svg' %}" />
and you also need to consider which app you should find your static files.
- [Django]-Django ORM access optimization with Filter
- [Django]-Why does Google ReCaptcha not prevent the submission of the form?