支持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 JPA。Eclipselink没有为mySQL提供密码,但它应该提供   我的Servlet和@FormDataParam存在java问题   java将什么作为上下文参数传递到文件I/O方法中?   如果两个值相同,java无法找到其中一个单选按钮   java在变量和方法名中使用下划线   JavaSpringMVC单线程安全?   klazz类的java Arraylist(反射Api)   java如何在数字字符串中查找最频繁的数字?   JavaAPI设计:使数据更易于阅读与强制更多API调用   JavaHadoopMapReduceforGoogleWebGraph   java无法启动gauge API:Runner意外退出   java如何在bluemix上使用ibm工作负载调度器?   拉取一年中某一周特定日期的所有日期   java为什么是我的角节点。js应用程序将图像上传到S3� 邮递员正确上传时的符号?   在不使用任何第三方jar的情况下将文件从本地传输到linux系统(java代码)   java将现有文件夹复制到Eclipse工作区中新创建的项目中   Java中的regex RegExp帮助   当使用“系统”外观时,Java组合框setSelectedItem会出现故障   JavaASM:在类的方法中获取局部变量名和值