将现有博客代码集成到Django-CMS中? [英] Integrate existing blog code into Django-CMS?

查看:348
本文介绍了将现有博客代码集成到Django-CMS中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我已经有一个使用Django完成的博客应用程序,并且我想使用它与我的新Django CMS站点,它是否可以简单地将其放入我的新Django CMS项目作为一个解耦的应用程序并将任何/博客/匹配到博客应用程序,适用于Django CMS插件?我想我需要知道的是什么时候最好将Django应用程序作为插件和整个应用程序编写?

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

推荐答案

是的,但你不要把它放到 urls.py ,您可以写一个 AppHook 将您的博客的URL方案绑定到CMS中的特定页面。

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.

插件是非常有用的。

您可能还需要将博客的路径包含在您网站上的导航痕迹或菜单中 - 在这种情况下,您需要编写一个自定义的菜单

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.

最后,在您的博客模型中使用django cms的占位符也可能会有用。他将允许您通过插件发布各种内容。

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.

这篇关于将现有博客代码集成到Django-CMS中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆