Integrate existing blog code into Django-CMS?

偶尔善良 提交于 2019-12-24 10:54:09

问题


If I already have a blog app done with Django and I want to use it with my new Django CMS site, is it okay to simply drop it into my new Django CMS project as a decoupled app and match anything /blog/ to the blog app as apposed to a Django CMS plugin? I guess what I need to know is when is it best to write my Django app as a plugin vs an entire app?

Thx

JeffC


回答1:


Yes, but you don't just drop it into the urls.py, instead you can write an AppHook to tie your blog's URL scheme to a particular page in your CMS.

Plugins on the other hand are useful if you want to inserts particular aspects of you app into other page's placeholders - for example to show your latest 3 posts on the frontpage.

You might also want to include your blog's paths in a breadcrumb or menu on your site - in that case you need to write a custom Menu too.

Finally, it might also be useful to make use of django cms's placeholders in you blog model. His would allow you to post a variety of content via plugins.



来源:https://stackoverflow.com/questions/10099822/integrate-existing-blog-code-into-django-cms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!