As the template to cut the text from the database?

As index.html trim to 50 characters of data from the field {{ post.text }} in models.py?
<div class="section">
 <div class="container">
 <div class="row">


 {% for post in latest_post_list %}
 <div class="col-lg-3">
 <div class="card" style="width: 18rem;">
 <img class="card-img-top" src="{{ post.image.url }}" alt="Card image cap" width="268" height="180">
 <div class="card-body">
 <h5 class="card-title">{{ post.title }}</h5>
 <p class="card-text">{{ post.text }}</p>
 <a href="#" class="btn btn-primary">Read</a>
</div>
</div>
</div>
 {% endfor %}
</div>
</div>
 </div>
June 8th 19 at 16:52
0 answer

Find more questions by tags PythonDjango