robertvari

post_detail.html

Jan 2nd, 2020
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.61 KB | None | 0 0
  1. {% extends '_base.html' %}
  2.  
  3. {% block title %} {{ post.title }} {% endblock title %}
  4.  
  5. {% block body %}
  6.     <div>
  7.         <div>{{ post.title }}</div>
  8.         <div>{{ post.description }}</div>
  9.         <div>Likes: {{ post.likes.all|length }}</div>
  10.  
  11.         <img src="{{ post.photo.url }}" alt="" style="max-width: 500px">
  12.         <div>
  13.             {% for comment in post.comments.all %}
  14.                 {{ comment.user }}<br>
  15.                 {{ comment.created_on }}<br>
  16.                 {{ comment.comment }}<br>
  17.                 <hr>
  18.             {% endfor %}
  19.         </div>
  20.  
  21.     </div>
  22. {% endblock body %}
Advertisement
Add Comment
Please, Sign In to add comment