Answer the question
In order to leave comments, you need to log in
Why is the image not showing on the page?
My django is broken, it thinks that I forgot to write {% endblock %} and gives the following error:
TemplateSyntaxError at /articles/asdas/
Invalid block tag on line 19: 'static', expected 'endblock'. Did you forget to register or load this tag?
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'assets')
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
{% extends 'base_layout.html' %}
{% block content %}
<div class='detail-container'>
<div class='article-detail'>
<img src='{{ article.thumb.url }}'>
{% if article.tags %}
<div class='tags'>
{% for tag in article.tags.all %}
<span>{{ tag.title }}</span>
{% endfor %}
</div>
{% endif %}
</img>
<h2>{{ article.title }}</h2>
<p>{{ article.body }}</p>
<h3>Written by {{ article.author.username }}</h3>
<p>{{ article.date }}</p>
<img src="{% static 'app/add.png' %}"> <!-- вот здесь -->
</div>
</div>
{% endblock %}
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