5👍
✅
Use the template filter linebreaksbr like so :
<p class="message">{{ product.message|linebreaksbr }}</p>
1👍
In order to have the line information you can use pre tag to keep track of empty spaces and new line.
let message = `Lorem ipsum text Lorem ipsum text Lorem ipsum text.
Lorem ipsum textLorem ipsum text
Lorem ipsum textLorem ipsum textLorem ipsum textLorem ipsum textLorem ipsum textLorem ipsum textLorem ipsum textLorem ipsum textLorem ipsum text`;
<div><pre>{message}</pre></div>
- [Django]-Django migration hell, dropped a table. Tried to get it back
- [Django]-Django: 'User' object has no attribute 'user'
- [Django]-How to do Delete confirmation for a table data with bootstrap Modal in Django?
- [Django]-Unable to override django-allauth templates
Source:stackexchange.com