带附件和标签的TurboGears2的可插拔极简博客

tgapp-smallpress的Python项目详细描述


关于tgapp smallpress

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

安装

tgapp smallpress既可以从pypi安装,也可以从bitbucket安装:

easy_install tgapp-smallpress

应该只对大多数用户有效

插入小型压力机

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

from tgext.pluggable import plug

然后在文件的结尾用smallpress调用plug:

plug(base_config, 'smallpress')

再次运行paster setup app development.ini以创建 与smallpress相关的表并启动应用程序。 您可以访问 http://localhost:8080/smallpress。管理图形用户界面 将在用户登录时可用 smallpress组。

启用WooSh索引< < /H2>

小出版社在POST索引中存在BLUT。 如果您已经安装了它,它将用于执行索引。 在搜索功能中更好地查找的文章。

启用时,whoosh将其索引存储到/tmp/smallpress\u whoosh 您可以通过更改smallpress-whoosh索引来更改此路径。 配置文件中的变量。

多个博客支持

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

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

暴露部分

smallpress公开了一组可以使用的部分 在您的 应用程序:

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

可用挂钩

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

可传递给plug的选项调用:

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

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

  • smallpress.before_create_article(article, values) -> Runs before the creation of an article
  • smallpress.after_create_article(article, values) -> Runs after the creation of an article, makes possible to set additional data for newly created articles
  • smallpress.before_edit_article(article, values) -> Runs before displaying the edit article form, makes possible to load additional form values
  • smallpress.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是否存在这样一种场景:Java7的Hashmap实现优于Java8的实现   java如何打印这些完整的数组?   java BuildException:未能执行aapt   java如何使用类。未知类型的集合返回的cast()   java准备语句返回错误的值   webview 安卓中的java显示身份验证对话框   java如何重命名列名JPA Hibernate   java查询从特定用户和特定时间段的Oracle表(通过比较原始表和备份表)中选择修改的行   java Youtube视频仅在三星S6设备上加载时自动暂停   未调用java RecyclerView getItemViewType   使用JSch setCommand执行带有源选项的java Shell ping命令时失败   java Hibernate:无法删除|删除分离的实例   Java Spring@MappedSuperclass字段作为子类中的@Id字段   java Android:确定单击了哪个按钮,因为该按钮未在xml中定义   如何计算java阵列内存使用率   使用Java查找按字母顺序排列的第一个字符串   javascript注销功能刷新页面,但页面仍已登录   当接口作为参数提供时,java依赖项注入不起作用   java中带原语的字符串扭曲