fix: media urls

This commit is contained in:
moanos [he/him] 2024-04-14 10:38:07 +02:00
parent c74e50ebf1
commit ab1246b6d0
3 changed files with 3 additions and 2 deletions

View File

@ -27,7 +27,7 @@
{% if adoption_notice.get_photo %}
<div class="adoption-notice-img">
<img title="{{ adoption_notice.get_photo.title }}"
src="/media/{{ adoption_notice.get_photo.image }}"
src="{{ MEDIA_URL }}/{{ adoption_notice.get_photo.image }}"
alt="{{ adoption_notice.get_photo.alt_text }}">
</div>
{% else %}

View File

@ -6,7 +6,7 @@
<div class="tag sex">{{ animal.get_sex_display }}</div>
</div>
{% if animal.get_photo %}
<img src="/media/{{ animal.get_photo.image }}" alt="{{ animal.get_photo.alt_text }}">
<img src="{{ MEDIA_URL }}/{{ animal.get_photo.image }}" alt="{{ animal.get_photo.alt_text }}">
</div>
{% else %}
{% translate "Keine Foto" %}

View File

@ -172,6 +172,7 @@ TEMPLATES = [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.media',
'django.contrib.messages.context_processors.messages',
],
},