Answer the question
In order to leave comments, you need to log in
Why are png images not showing in django?
I'm using django-avatar to allow people to upload their own avatars. Jpg images are displayed correctly, but png are not:
I think my image display is set up correctly.
settings.py:
STATIC_ROOT = os.path.join(BASE_DIR, '/static')
STATIC_URL = '/static/'
MEDIA_URL = '/IMG/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'static/IMG')
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
{% load avatar_tags %}
{% render_avatar avatar 250 %}
{% load account %}
{% user_display user %}
{% load i18n %}
{% load static %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question