I have a model with an attribute,
desc = models.TextField()
I entered data using admin interface provided by Django and then later viewed my template where the database values are fetched and displayed.
In my admin interface I left newline (just by leaving blank lines in between my paragraphs) but they are displayed as a single paragraph in my template.
I'm using Django 1.3 and MySQL.
linebreaks
Replaces line breaks in plain text with appropriate HTML; a single newline becomes an HTML line break (
<br />
) and a new line followed by a blank line becomes a paragraph break (</p>
).For example:
{{ value|linebreaks }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With