The only reason I include Python in the question is: PHP has a function nl2brthat inserts tags br, a similar function in Python may be useful, but I suspect that this problem can be solved using HTML and CSS.
So, I have a form that takes user input in a text box. I save it in the database, which is Postgres, and then when I show it, it does not include the line that interrupts the user provided to the individual paragraphs.

I tried using the CSS property white-spacein the paragraph tag:
white-space: pre
or
white-space: pre-wrap
But this is strange, the result was highlighted lines, but the first line is aligned in the middle:

including text-align:leftdoes not solve the problem. I am sure there is a simple solution.