0

我有:

...
post_str = "Please input the following information... \nDescription: \n Last Name:"
context = {
     'post_str':post_str,
      ...
}
return render_to_response('contact/contact.html', context, context_instance=RequestContext(request))

它像这样打印,

Please input the following information... Description: Last Name:.

但我希望它打印出来:

Please input the following information...
Description:
Last Name:

我以为我使用正确。如何获得换行符以成功生产我需要的东西?

提前感谢您的帮助。

4

1 回答 1

1

换行符在 HTML 中没有任何作用。改为使用<br />

于 2012-09-25T18:52:36.987 回答