<textarea id="my" ></textarea>
p=post(body=value)
p.save()
Here I am trying to save the content of the textarea to database开发者_开发问答 but i see that new lines are converted to spaces and then saved.How to handle this on the server side..
They're almost certainly not being converted to new-lines, the problem is likely to be the way you're displaying them.
Try displaying them in your template using the linebreaks
filter, like this:
{{ mypost.body|linebreaks }}
精彩评论