[英]trouble trying to show an image from my static folder in a django template
即時通訊試圖顯示我的模板中的圖像,如果個人資料沒有任何圖片。 我的模板中有此代碼
{% if not profileForm.avatar %}
<img src="{% static 'img/empty-profile-picture.png' %}" alt="" />
{% endif %}
我得到那個錯誤
Template error:
In template /home/jaime/djcode/urgencias/templates/usuarios/profile_edit.html, error at line 68
Invalid block tag: 'static', expected 'elif', 'else' o 'endif'
你有一個錯字-關鍵字是static
,而不是satic
。
我也通過將丟失的{% load staticfiles %}
放在子模板的開頭來解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.