支持sqlalchemy和mongodb的turbogears2可插拔博客

tgapp-turbopress的Python项目详细描述


关于TGAP涡轮增压器

https://drone.io/bitbucket.org/axant/tgapp-turbopress/status.png

TurboPress是TurboGears2的一个可插入的极简博客。 它实现了带有附件和标签支持的文章。 使用ckeditor进行内容编辑。 它同时支持sqla和ming orm。

安装

tgapp涡轮增压器既可以从pypi安装,也可以从bitbucket安装:

pip install tgapp-turbopress

应该只对大多数用户有效

插入涡轮增压器

在应用程序中config/app_cfg.py导入plug

from tgext.pluggable import plug

然后在文件的结尾处,用TurboPress调用插头:

plug(base_config, 'turbopress')

再次运行gearbox setup app development.ini以创建 有关TurboPress的表格并启动应用程序。 您可以访问 http://localhost:8080/按。管理图形用户界面 将在与以下用户一起登录时可用 拥有turbopress权限。

多个博客支持

默认情况下,TurboPress只支持一个博客,但它支持 初步的多博客实现。搜索和标记云将 被所有的博客分享,但是可以过滤文章 只管理一个博客的文章。

要创建博客访问/press/blogs并创建新的访问, 然后您将能够访问子博客并通过访问 /按/blogname

暴露部分

涡轮压力机暴露了一堆可以使用的部分 在您的 应用程序:

  • turbopress.partials:articles -> Renders the list of articles
  • turbopress.partials:article_preview -> Renders the preview of an article
  • turbopress.partials:tagcloud -> Renders the blog tagcloud section
  • turbopress.partials:search -> Renders the blog search section
  • turbopress.partials.excerpts -> Renders excerpts of a list of articles
  • turbopress.partials.excerpt -> Renders the excerpt of an article

可用挂钩

TurboPress公开了一些钩子和选项来配置它的 方面。

可传递给plug的选项调用:

  • form -> Full python path of the form class to use for the Article form. By default turbopress.lib.forms.ArticleForm is used.

可与涡轮齿轮2寄存器挂钩一起使用的挂钩是:

  • turbopress.before_create_article(article, values) -> Runs before the creation of an article
  • turbopress.after_create_article(article, values) -> Runs after the creation of an article, makes possible to set additional data for newly created articles
  • turbopress.before_edit_article(article, values) -> Runs before displaying the edit article form, makes possible to load additional form values
  • turbopress.before_save_article(article, values) -> Runs before saving the article after it got edited, makes possible to update additional data for the article.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何通过解决错误“活动无法转换为片段”将片段传递给类构造函数?   Java中清理Code39条码数据的regex帮助   将java转换为C++   java无法在Android Studio中生成签名的apk,出现错误   从数学方程出发   MySQL和Java内存问题   如何强制Java抛出算术异常?   java为什么JDBC将零端口视为空(默认)端口?   java如何在没有“changelog主题”的情况下加入KStream和KTable   排序我尝试合并两个排序的数组,但得到的是java。lang.ArrayIndexOutofBounds异常:5无法找出原因   如何在java中求大长度矩阵的逆?   基于maven构建的java生成类路径字符串   java每20个字符分割一个字符串,然后将每个部分打印到控制台   将字符串数字字转换为字符串数字:Java   在特定区域使用混合类型的java填充字节数组   尽管java类在开关块中实例化,但它只能调用接口方法