python - django做博客时候model里面是怎么做的?
巴扎黑
巴扎黑 2017-04-17 12:58:20
0
3
361

初学编程,没有经验,请教大家。
我们平时写博客的时候,都是有所见即所得工具帮忙,然后将文章存进数据库。
我有如下疑问:

  1. 在django里怎么样,才可以使得写文章时可以使用所见即所得工具;
  2. 所见即所得是怎么与model结合的。我是指model关于这块该怎么写。因为写文章里肯定很多/n/n,还有加粗,引用一类的用法。
    想看一眼,看了应该就明白了。
    感谢
巴扎黑
巴扎黑

reply all(3)
刘奇

I used a visual editor before http://rsj217.diandian.com/post/2013-09-14/40053589622
Simple and hassle-free. But now the markdown visual editor seems to be more popular.

To put it simply, model can provide a field to save labeled text. As for adding tags, leave it to the editor. The front desk will display it according to the needs.

刘奇

Here you need a rich text editor, which has nothing to do with Django's model. The model accepts plain text, and the editor and content rendering are both on the front end.

伊谢尔伦
  1. Model is only used to create objects that store data
  2. For label processing, you should use a rich text editor, such as TinyMCE
  3. Generally create a model object to save long text, and then save the data submitted through the rich text editor on the page into this object.
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!